Skip to content

Commit

Permalink
Fix tests for Node.js 21
Browse files Browse the repository at this point in the history
  • Loading branch information
myrotvorets-team committed Oct 26, 2023
1 parent 4093883 commit c2f0a1d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .mocharc.cjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
/** @type {string[]} */
let options;
if (parseInt(process.versions.node.split('.')[0]) >= 21) {
options = ['loader=testdouble', 'loader=ts-node/esm', 'no-warnings'];
} else {
options = ['loader=ts-node/esm', 'loader=testdouble', 'no-warnings'];
}

/** @type {import('mocha').MochaOptions} */
module.exports = {
recursive: true,
extension: ['.test.mts'],
'node-option': ['loader=ts-node/esm', 'loader=testdouble', 'no-warnings'],
'node-option': options,
require: 'mocha.setup.mjs',
reporter: 'mocha-multi',
'reporter-option': [
Expand Down

0 comments on commit c2f0a1d

Please sign in to comment.