Skip to content

Commit c2bfe36

Browse files
committed
test: skip bigint test on proper platform
1 parent 4443177 commit c2bfe36

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

test/node/parser/calculate_size.test.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,18 @@ describe('calculateSize()', () => {
2525
).to.throw(BSONVersionError, /Unsupported BSON version/i);
2626
});
2727

28-
it('returns 8 bytes (+7 meta bytes) size for a bigint value', function () {
29-
const doc = { a: BigInt(1) };
30-
expect(BSON.calculateObjectSize(doc)).to.equal(16);
31-
expect(BSON.calculateObjectSize(doc)).to.equal(BSON.serialize(doc).byteLength);
28+
describe('bigint', function () {
29+
beforeEach(function () {
30+
if (BSON.__noBigInt__) {
31+
this.currentTest?.skip();
32+
}
33+
});
34+
35+
it('returns 8 bytes (+7 meta bytes) size for a bigint value', function () {
36+
const doc = { a: BigInt(1) };
37+
expect(BSON.calculateObjectSize(doc)).to.equal(16);
38+
expect(BSON.calculateObjectSize(doc)).to.equal(BSON.serialize(doc).byteLength);
39+
});
3240
});
3341

3442
it('returns 0 bytes (+5 meta bytes) for a symbol value', function () {

0 commit comments

Comments
 (0)