chore: add jest config

This commit is contained in:
Il Harper 2024-03-03 23:49:16 +08:00
parent 3c4abe9fa1
commit 3a5aa74378
No known key found for this signature in database
GPG Key ID: 4B71FCA698E7E8EC

22
jest.config.ts Normal file
View File

@ -0,0 +1,22 @@
import type { JestConfigWithTsJest } from 'ts-jest'
const config: JestConfigWithTsJest = {
preset: 'ts-jest/presets/default-esm',
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform: {
'^.+\\.m?[tj]sx?$': [
'ts-jest',
{
useESM: true,
},
],
},
collectCoverage: true,
coverageDirectory: 'coverage',
coverageProvider: 'v8',
}
// eslint-disable-next-line import/no-default-export
export default config