Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

Commit

Permalink
Fix Jest defect, deprecations on Node 20
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew W. Harn <[email protected]>
  • Loading branch information
awharn committed Oct 18, 2023
1 parent eea6c93 commit 5e54e7f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
11 changes: 9 additions & 2 deletions __tests__/config/jest.preset.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@
}
},
"moduleFileExtensions": ["ts","js"],
"testResultsProcessor": "jest-stare",
"testEnvironment": "node",
"transform": {
".(ts)": "ts-jest"
}
},
"transformIgnorePatterns": ["^.+\\.js$", "^.+\\.json$"],
"reporters": [
["github-actions", {"silent": false}],
"default",
"jest-junit"
],
"globalSetup": "./__tests__/config/setup.js",
"globalTeardown": "./__tests__/config/teardown.js"
}
3 changes: 3 additions & 0 deletions __tests__/config/setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = async function (globalConfig, projectConfig) {
require('events').EventEmitter.defaultMaxListeners = Infinity;
}
3 changes: 3 additions & 0 deletions __tests__/config/teardown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = async function (globalConfig, projectConfig) {
process.exitCode = 0; // Thanks Node 20
}
3 changes: 2 additions & 1 deletion tsconfig-tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@
],
"files": [
"./__types__/wontache.d.ts"
]
],
"allowJs": true
}

0 comments on commit 5e54e7f

Please sign in to comment.