forked from virattt/dexter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
41 lines (40 loc) · 1.15 KB
/
jest.config.js
File metadata and controls
41 lines (40 loc) · 1.15 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
/** @type {import('ts-jest').JestConfigWithTsJest} */
export default {
preset: 'ts-jest/presets/default-esm',
testEnvironment: 'node',
extensionsToTreatAsEsm: ['.ts', '.tsx'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform: {
// Transform TypeScript files with ts-jest
'^.+\\.tsx?$': [
'ts-jest',
{
useESM: true,
tsconfig: 'tsconfig.json',
},
],
// Transform ESM JavaScript packages from node_modules with babel-jest
'node_modules/(p-retry|is-network-error|@langchain)/.+\\.js$': [
'babel-jest',
{
presets: [['@babel/preset-env', { targets: { node: 'current' } }]],
},
],
},
// Transform ESM packages from node_modules that Jest can't handle natively
transformIgnorePatterns: [
'node_modules/(?!(p-retry|is-network-error|@langchain)/)',
],
testMatch: ['**/__tests__/**/*.test.ts'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
collectCoverageFrom: [
'src/agent/**/*.ts',
'!src/agent/**/*.test.ts',
'!src/agent/__tests__/**',
'!src/agent/index.ts',
],
coverageDirectory: 'coverage',
verbose: true,
};