We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Original comment:
I’m getting this issue with Node.js’s built-in assert.strictEqual function only when using with Mocha. When running Node (v14.15.0) on the command line, assert.strictEqual(0n, 1n); I get the error: Uncaught AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 0n !== 1n This is as expected, as the error reports what it should report. But when running in Mocha (with gulp and ts-node): import * as assert from 'assert'; // Node.js describe('module', () => { it('test', () => { assert.strictEqual(0n, 1n); }); }); TypeError: Do not know how to serialize a BigInt at JSON.stringify (<anonymous>) at processImmediate (internal/timers.js:461:21) Any idea why assert.strictEqual runs differently in Mocha than in the Node.js REPL? Configurations: (click to expand) Gulp file: function test() { return gulp.src('./test/**/*.ts') .pipe(mocha({ require: 'ts-node/register', })) } NPM dependencies: "devDependencies": { "@types/mocha": "^8.0.0", "@types/node": "^14.0.1", "gulp": "^4.0.2", "gulp-mocha": "^7.0.2", "gulp-typescript": "^5.0.1", "ts-node": "^9.0.0", "typescript": "~4.0.3" },
I’m getting this issue with Node.js’s built-in assert.strictEqual function only when using with Mocha.
assert.strictEqual
When running Node (v14.15.0) on the command line,
assert.strictEqual(0n, 1n);
I get the error:
Uncaught AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 0n !== 1n
Uncaught AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
0n !== 1n
This is as expected, as the error reports what it should report.
But when running in Mocha (with gulp and ts-node):
import * as assert from 'assert'; // Node.js describe('module', () => { it('test', () => { assert.strictEqual(0n, 1n); }); });
TypeError: Do not know how to serialize a BigInt at JSON.stringify (<anonymous>) at processImmediate (internal/timers.js:461:21)
Any idea why assert.strictEqual runs differently in Mocha than in the Node.js REPL?
function test() { return gulp.src('./test/**/*.ts') .pipe(mocha({ require: 'ts-node/register', })) }
"devDependencies": { "@types/mocha": "^8.0.0", "@types/node": "^14.0.1", "gulp": "^4.0.2", "gulp-mocha": "^7.0.2", "gulp-typescript": "^5.0.1", "ts-node": "^9.0.0", "typescript": "~4.0.3" },
This seems to be fixed with mochajs/mocha#4112, but that is in mocha v8.3.0, and this project only uses version ^6. I tried submitting a PR to retroactively apply the fix to v6, but they denied saying that LTS is not pursued.
One possible solution to this issue would be to upgrade to mocha ^8.3.
The text was updated successfully, but these errors were encountered:
4fa531f
No branches or pull requests
Original comment:
This seems to be fixed with mochajs/mocha#4112, but that is in mocha v8.3.0, and this project only uses version ^6. I tried submitting a PR to retroactively apply the fix to v6, but they denied saying that LTS is not pursued.
One possible solution to this issue would be to upgrade to mocha ^8.3.
The text was updated successfully, but these errors were encountered: