Skip to content

Commit

Permalink
test: fix ts-jest module resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
myfreeer committed Oct 5, 2024
1 parent df152cb commit c7ab467
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
17 changes: 17 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/** @type {import('@jest/types').Config.ProjectConfig} */
const config = {
transform: {
'\\.[jt]sx?$': 'ts-jest',
},
'globals': {
'ts-jest': {
'useESM': true
}
},
moduleNameMapper: {
'^\\.(.+)\\.js': '.$1'
},
extensionsToTreatAsEsm: ['.ts'],
};

module.exports = config;
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
"prepack": "npm run clean && npm run build",
"postshrinkwrap": "node package-lock-resolved.js"
},
"jest": {
"preset": "ts-jest"
},
"dependencies": {
"cheerio": "^1.0.0",
"css-url-parser": "^1.1.3",
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"esModuleInterop": true,
"removeComments": false,
"strict": true,
"declarationMap": true
"declarationMap": true,
"allowJs": true
},
"include": [
"src"
Expand Down

0 comments on commit c7ab467

Please sign in to comment.