-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
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
Bigint support. #4090
Comments
I mean, it looks like |
searching around, coercing to string looks like it's the workaround. since we're using |
Anything is better than the current situation. 😄 As for how to render, what you suggested is fine. I would also be fine with |
@boneskull i made a pull request to solve this bug, can you review it? |
I’m getting this issue with Node.js’s built-in When running Node (v14.15.0) on the command line, assert.strictEqual(0n, 1n); I get the error:
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);
});
});
Any idea why 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" }, |
@chharvey If you use |
@juergba Thank you for providing a fix for this. But for the record, However, by wrapping the bigints in arrays, assert.deepStrictEqual([0n], [1n]); this did give me the correct error. |
Prerequisites
faq
labelnode node_modules/.bin/mocha --version
(Local) andmocha --version
(Global). We recommend that you not install Mocha globally.Description
bigint
is now a Stage 4 proposal but if you assert on abigint
Mocha fails during serialization of the error. I don't know how to reproduce this issue withoutChai
, but the error context suggests that the problem is with Mocha's error serializer, not Chai.Steps to Reproduce
Expected behavior: [What you expect to happen]
Chai doesn't natively support
bigint
either (separate issue), but it at least doesn't error on reporting. For now, I would expect to see Chai's worthless error message that at least pointed to the right test/line.Actual behavior: [What actually happens]
Reproduces how often: [What percentage of the time does it reproduce?]
100%
Versions
mocha --version
andnode node_modules/.bin/mocha --version
: 6.2.2node --version
: v12.3.0The text was updated successfully, but these errors were encountered: