@inithink/nest-tool
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

nest-tool

nestjs 개발시 도움될만한 것들을 모아둠

세팅법

  1. AppModule 안에 CommonModule을 등록한다.
@Module({
  imports: [
    // ...
    CommonModule
  ],
  // ...
})
export class AppModule {
}
  1. App 생성시 logger에 new NestLoggerService()를 등록한다.
const app = await NestFactory.create(AppModule, {
  logger: new NestLoggerService(),
});
  1. jest setup 시에 테스트때 사용할 AppModule과 setupApp 함수를 등록한다.
testSetup(AppModule, setupApp);
  1. mocking이 필요하다면 가져다 쓴다.
// <jestRootDir>/__mocks__/bcryptjs.ts
export * from '@inithink/nest-tool/dist/mocks/bcryptjs';
// <jestRootDir>/__mocks__/@nestjs/typeorm.ts
export * from '@inithink/nest-tool/dist/mocks/@nestjs/typeorm';

Readme

Keywords

none

Package Sidebar

Install

npm i @inithink/nest-tool

Weekly Downloads

2

Version

1.2.0

License

ISC

Unpacked Size

43.4 kB

Total Files

41

Last publish

Collaborators

  • inithink