Skip to content

Commit

Permalink
refactor: enhance Jest configuration for ESM support and improve modu…
Browse files Browse the repository at this point in the history
…le resolution
  • Loading branch information
JeelRajodiya committed Dec 29, 2024
1 parent d15c741 commit 279237c
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,24 @@ module.exports = {
coverageDirectory: 'coverage',
collectCoverageFrom: ['scripts/**/*.ts'],
coveragePathIgnorePatterns: ['scripts/compose.ts', 'scripts/tools/categorylist.ts', 'scripts/tools/tags-color.ts'],
// To disallow netlify edge function tests from running
testMatch: ['**/tests/**/*.test.*', '!**/netlify/**/*.test.*'],
extensionsToTreatAsEsm: ['.ts', '.tsx'],
transform: {
'^.+.tsx?$': [
'^.+\\.tsx?$': [
'ts-jest',
{
useESM: true,
tsconfig: {
module: 'ESNext'
module: 'ESNext',
moduleResolution: 'node',
resolveJsonModule: true,
esModuleInterop: true
}
}
]
],
'^.+\\.json$': ['ts-jest', { useESM: true }]
},
extensionsToTreatAsEsm: ['.ts', '.tsx'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1'
}
};

0 comments on commit 279237c

Please sign in to comment.