Skip to content

Commit 2177c67

Browse files
WesSouzaarturbien
authored andcommitted
fix(coverage): fix Jest coverage not properly referencing code points correctly
Code coverage depends on TypeScript sourceMap, which we disabled for builds.
1 parent 7efe96c commit 2177c67

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

jest.config.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
module.exports = {
22
globals: {
3-
extensionsToTreatAsEsm: ['.js'],
43
'ts-jest': {
54
diagnostics: false,
6-
isolatedModules: true,
7-
useESM: true
5+
isolatedModules: true
86
}
97
},
10-
preset: 'ts-jest/presets/js-with-ts-esm',
8+
coverageReporters: ['text', 'html'],
9+
preset: 'ts-jest/presets/default-esm',
1110
setupFilesAfterEnv: ['<rootDir>/test/setup-test.ts'],
1211
testEnvironment: 'jsdom'
1312
};

tsconfig.build.index.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"compilerOptions": {
44
"emitDeclarationOnly": true,
55
"outDir": "./dist",
6-
"rootDir": "./src"
6+
"rootDir": "./src",
7+
"sourceMap": false
78
},
89
"include": [
910
"types/global.d.ts",

tsconfig.build.themes.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"emitDeclarationOnly": true,
55
"outDir": "./dist/themes",
66
"rootDir": "./src/common/themes",
7+
"sourceMap": false
78
},
89
"include": [
910
"src/common/themes/*.ts",

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"resolveJsonModule": true,
3131
"rootDir": "./",
3232
"skipLibCheck": true,
33-
"sourceMap": false,
33+
"sourceMap": true,
3434
"strict": true,
3535
"strictFunctionTypes": true,
3636
"strictNullChecks": true,

0 commit comments

Comments
 (0)