diff --git a/.mocharc.js b/.mocharc.js index f36eb4422f3..49d567fb76a 100644 --- a/.mocharc.js +++ b/.mocharc.js @@ -6,7 +6,6 @@ const [major] = process.versions.node.split('.'); module.exports = { require: [ 'test/mocha_root_hooks.ts', - 'source-map-support/register', 'ts-node/register', 'test/tools/runner/throw_rejections.cjs', 'test/tools/runner/chai_addons.ts', @@ -19,5 +18,8 @@ module.exports = { reporter: 'test/tools/reporter/mongodb_reporter.js', sort: true, color: true, - 'node-option': Number(major) >= 23 ? ['no-experimental-strip-types'] : undefined + 'node-option': + Number(major) >= 23 + ? ['enable-source-maps', 'no-experimental-strip-types'] + : ['enable-source-maps'] }; diff --git a/package.json b/package.json index 290e0e8c706..883d7775699 100644 --- a/package.json +++ b/package.json @@ -141,8 +141,10 @@ "check:dts": "npm run build:bundle && node ./node_modules/typescript/bin/tsc --target es2023 --module commonjs --noEmit mongodb.d.ts && tsd", "check:search-indexes": "npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/manual/search-index-management.prose.test.ts", "check:test": "npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/integration", + "check:test:debug": "npm run mocha:debug -- --config test/mocha_mongodb.js test/integration", "check:test-bundled": "MONGODB_BUNDLED=true npm run check:test", "check:unit": "npm run build:bundle && nyc mocha test/unit", + "check:unit:debug": "npm run mocha:debug -- test/unit", "check:unit-bundled": "MONGODB_BUNDLED=true npm run check:unit", "check:ts": "node ./node_modules/typescript/bin/tsc -v && node ./node_modules/typescript/bin/tsc --noEmit", "check:atlas": "npm run build:bundle && nyc mocha --config test/manual/mocharc.js test/manual/atlas_connectivity.test.ts", @@ -157,6 +159,7 @@ "check:csfle": "npm run build:bundle && nyc mocha --config test/mocha_mongodb.js test/integration/client-side-encryption", "check:snappy": "npm run build:bundle && nyc mocha test/unit/assorted/snappy.test.js", "check:x509": "npm run build:bundle && nyc mocha test/manual/x509_auth.test.ts", + "mocha:debug": "npm run build:bundle && node --inspect --enable-source-maps --no-experimental-strip-types ./node_modules/mocha/bin/mocha.js", "build:bundle": "npm run bundle:driver && npm run bundle:types && npm run build:runtime-barrel", "build:runtime-barrel": "node etc/build-runtime-barrel.mjs", "bundle:driver": "node etc/bundle-driver.mjs", diff --git a/test/manual/mocharc.js b/test/manual/mocharc.js index 2d8d9e113e9..ad7470f333b 100644 --- a/test/manual/mocharc.js +++ b/test/manual/mocharc.js @@ -15,5 +15,8 @@ module.exports = { failZero: true, color: true, timeout: 10000, - 'node-option': Number(major) >= 23 ? ['no-experimental-strip-types'] : undefined + 'node-option': + Number(major) >= 23 + ? ['enable-source-maps', 'no-experimental-strip-types'] + : ['enable-source-maps'] }; diff --git a/test/mocha_lambda.js b/test/mocha_lambda.js index 1905967fdb6..03ed1d6a470 100644 --- a/test/mocha_lambda.js +++ b/test/mocha_lambda.js @@ -18,5 +18,8 @@ module.exports = { reporter: 'test/tools/reporter/mongodb_reporter.js', sort: true, color: true, - 'node-option': Number(major) >= 23 ? ['no-experimental-strip-types'] : undefined + 'node-option': + Number(major) >= 23 + ? ['enable-source-maps', 'no-experimental-strip-types'] + : ['enable-source-maps'] }; diff --git a/test/mocha_mongodb.js b/test/mocha_mongodb.js index 51b7aebb28e..5caa620c124 100644 --- a/test/mocha_mongodb.js +++ b/test/mocha_mongodb.js @@ -7,7 +7,6 @@ const [major] = process.versions.node.split('.'); module.exports = { require: [ 'test/mocha_root_hooks.ts', - 'source-map-support/register', 'ts-node/register', 'test/tools/runner/throw_rejections.cjs', 'test/tools/runner/chai_addons.ts', @@ -32,5 +31,8 @@ module.exports = { 'test/integration/node-specific/examples/transactions.test.js', 'test/integration/node-specific/examples/versioned_api.js' ], - 'node-option': Number(major) >= 23 ? ['no-experimental-strip-types'] : undefined + 'node-option': + Number(major) >= 23 + ? ['enable-source-maps', 'no-experimental-strip-types'] + : ['enable-source-maps'] }; diff --git a/test/tools/runner/hooks/configuration.ts b/test/tools/runner/hooks/configuration.ts index 0220d81fb9b..db6a50344b2 100644 --- a/test/tools/runner/hooks/configuration.ts +++ b/test/tools/runner/hooks/configuration.ts @@ -1,10 +1,5 @@ /* eslint-disable simple-import-sort/imports */ -// eslint-disable-next-line @typescript-eslint/no-require-imports -require('source-map-support').install({ - hookRequire: true -}); - import * as process from 'process'; import * as os from 'os';