Skip to content

Instantly share code, notes, and snippets.

@nishabe
Created January 7, 2021 15:07
Show Gist options
  • Save nishabe/c4a1aeb33a42748a66cb9a4e6159d9f2 to your computer and use it in GitHub Desktop.
Save nishabe/c4a1aeb33a42748a66cb9a4e6159d9f2 to your computer and use it in GitHub Desktop.
api.service.spec.ts
import { Test, TestingModule } from '@nestjs/testing';
import { ApiService } from './api.service';
import { HttpModule } from '@nestjs/common';
describe('ApiService', () => {
let service: ApiService;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [ApiService],
imports: [HttpModule],
}).compile();
service = module.get<ApiService>(ApiService);
});
it('ApiService - should be defined', () => {
expect(service).toBeDefined();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment