本文整理匯總了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);
});