refactor: write jest config in ts (#485)

* refactor: write jest config in ts

Signed-off-by: Rui Chen <rui@chenrui.dev>

* chore: exclude jest.config.ts in tsconfig

Signed-off-by: Rui Chen <rui@chenrui.dev>

* chore: run build

Signed-off-by: Rui Chen <rui@chenrui.dev>

---------

Signed-off-by: Rui Chen <rui@chenrui.dev>
This commit is contained in:
Rui Chen 2024-07-18 16:35:10 -04:00 committed by GitHub
parent f808f15ba8
commit 20adb4259c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 176 additions and 20 deletions

16
jest.config.ts Normal file
View file

@ -0,0 +1,16 @@
import type { JestConfigWithTsJest } from 'ts-jest';
const config: JestConfigWithTsJest = {
preset: 'ts-jest/presets/default-esm',
clearMocks: true,
moduleFileExtensions: ['js', 'ts'],
testEnvironment: 'node',
testMatch: ['**/*.test.ts'],
testRunner: 'jest-circus/runner',
transform: {
'^.+\\.ts$': 'ts-jest',
},
verbose: true,
};
export default config;