本文整理汇总了TypeScript中@nestjs/testing/testing-module.TestingModule类的典型用法代码示例。如果您正苦于以下问题:TypeScript TestingModule类的具体用法?TypeScript TestingModule怎么用?TypeScript TestingModule使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TestingModule类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: describe
describe('JwtValidatorService', () => {
let module: TestingModule;
beforeEach(() => {
return Test.createTestingModule({
components: [
JwtValidatorService
]
}).compile()
.then(compiledModule => module = compiledModule);
});
let service: JwtValidatorService;
beforeEach(() => {
service = module.get(JwtValidatorService);
});
it('should exist', () => {
expect(service).to.exist;
});
});
示例2: describe
describe('AccountController', () => {
let module: TestingModule;
beforeEach(() => {
return Test.createTestingModule({
controllers: [
AccountController
]
}).compile()
.then(compiledModule => module = compiledModule);
});
let controller: AccountController;
beforeEach(() => {
controller = module.get(AccountController);
});
it('should exist', () => {
expect(controller).to.exist;
});
});
示例3: beforeEach
beforeEach(() => {
controller = module.get(AccountController);
});
示例4: beforeEach
beforeEach(() => {
service = module.get(JwtValidatorService);
});
示例5: beforeEach
beforeEach(() => {
controller = module.get(ImagesController);
});
示例6: beforeEach
beforeEach(() => {
service = module.get(JwtGeneratorService);
});
示例7: beforeEach
beforeEach(() => {
service = module.get(AuthService);
});
示例8: beforeEach
beforeEach(() => {
service = module.get(PasswordHashService);
});
示例9: beforeEach
beforeEach(() => {
controller = module.get(AuthController);
});