forked from elastic/esql-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
28 lines (27 loc) · 846 Bytes
/
jest.config.js
File metadata and controls
28 lines (27 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/** @type {import('jest').Config} */
const config = {
testEnvironment: 'node',
roots: ['<rootDir>/src'],
// Disable Prettier for inline snapshots (Jest 29 does not support Prettier 3.x)
prettierPath: null,
// Only treat *.test.ts files as test suites (excludes fixtures, helpers, etc. in __tests__/)
testMatch: ['**/*.test.ts'],
moduleNameMapper: {
// rewriteRelativeImportExtensions rewrites .ts → .js in transpiled output;
// this maps those .js imports back so Jest can resolve the .ts source files
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform: {
'^.+\\.[jt]s$': [
'ts-jest',
{
useESM: false,
tsconfig: {
// Override to CommonJS for tests so --experimental-vm-modules is not needed
module: 'commonjs',
},
},
],
},
};
export default config;