test: 跑通测试用例。
This commit is contained in:
@ -1,12 +1,20 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { ProjectsService } from './projects.service';
|
||||
import { getRepositoryToken } from '@nestjs/typeorm';
|
||||
import { Project } from './project.entity';
|
||||
|
||||
describe('ProjectsService', () => {
|
||||
let service: ProjectsService;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [ProjectsService],
|
||||
providers: [
|
||||
ProjectsService,
|
||||
{
|
||||
provide: getRepositoryToken(Project),
|
||||
useValue: {},
|
||||
},
|
||||
],
|
||||
}).compile();
|
||||
|
||||
service = module.get<ProjectsService>(ProjectsService);
|
||||
|
Reference in New Issue
Block a user