Skip to content

Commit f1fe7cd

Browse files
committed
jest and ts configs
1 parent e066858 commit f1fe7cd

10 files changed

Lines changed: 2607 additions & 2005 deletions

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@ npm-debug.log*
2121

2222
.idea
2323

24-
lib
24+
lib
25+
26+
tsconfig.tsbuildinfo

jest.config.mjs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
const jestConfig = {
3+
clearMocks: true,
4+
coverageDirectory: "coverage",
5+
coverageProvider: "v8",
6+
testEnvironment: "node",
7+
testMatch: ["<rootDir>/src/**/*.spec.ts"],
8+
extensionsToTreatAsEsm: ['.ts'],
9+
// Use the native ESM preset provided by ts-jest
10+
preset: 'ts-jest/presets/default-esm',
11+
12+
transform: {
13+
// Ensure ts-jest processes your TS files as ES Modules
14+
'^.+\\.ts$': [
15+
'ts-jest',
16+
{
17+
useESM: true,
18+
tsconfig: '<rootDir>/tsconfig.json',
19+
},
20+
],
21+
},
22+
23+
// Since chrome-har is an ES Module, let Jest resolve it properly
24+
moduleNameMapper: {
25+
'^(\\.{1,2}/.*)\\.js$': '$1',
26+
},
27+
}
28+
29+
export default jestConfig

jest.config.ts

Lines changed: 0 additions & 199 deletions
This file was deleted.

0 commit comments

Comments
 (0)