OMDSCloud/dictation_server/src/features/auth/auth.controller.spec.ts
saito.k f553bfc95b Merged PR 501: strictNullChecks修正①(accounts,auth,Repositoiesのaccounts,common)
## 概要
[Task2835: 修正①(accounts,auth,Repositoiesのaccounts,common)](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/2835)

- features
  - accounts
  - auth
- common
- repositories
  - accounts
- 各entity
  - Nullableの項目の`@Column`デコレータに`type`を追加しないとTypeORMがエラーになりテストが通らないので追加
    - https://qiita.com/maruware/items/08c9ad594e14e4ea1497#%E5%95%8F%E9%A1%8C

## レビューポイント
- コメントとして記載

## UIの変更
- Before/Afterのスクショなど
- スクショ置き場

## 動作確認状況
- ローカルで確認、develop環境で確認など

## 補足
- レビュー完了後、TODOコメント(strictNullChecks対応)は削除します
2023-10-19 07:13:56 +00:00

34 lines
923 B
TypeScript

import { Test, TestingModule } from '@nestjs/testing';
import { AuthController } from './auth.controller';
import { AuthService } from './auth.service';
import {
makeAdB2cServiceMock,
makeDefaultAdB2cMockValue,
} from './test/auth.service.mock';
import { ConfigModule } from '@nestjs/config';
describe('AuthController', () => {
let controller: AuthController;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
imports: [
ConfigModule.forRoot({
envFilePath: ['.env.local', '.env'],
isGlobal: true,
}),
],
controllers: [AuthController],
providers: [AuthService],
})
.useMocker(() => makeAdB2cServiceMock(makeDefaultAdB2cMockValue()))
.compile();
controller = module.get<AuthController>(AuthController);
});
it('should be defined', () => {
expect(controller).toBeDefined();
});
});