의존성

yarn add -D typescript jest @types/jest ts-node ts-jest 

jest.config.ts 추가

module.exports = {
  preset: 'ts-jest',
  testEnvironment: 'node',
  transform: {
    '^.+\\.tsx?$': 'ts-jest',
  },
  moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
  transformIgnorePatterns: ['/node_modules/'],
};

프로젝트폴더의 jest.config.ts 에 위치

tsconfig.json 수정

{
  "compilerOptions": {
      "types" : [
          "jest"
      ]
  }
}

typesjest 추가