Skip to content

Commit

Permalink
test: skip bigint test on proper platform
Browse files Browse the repository at this point in the history
  • Loading branch information
nbbeeken committed Dec 16, 2024
1 parent 4443177 commit c2bfe36
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions test/node/parser/calculate_size.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,18 @@ describe('calculateSize()', () => {
).to.throw(BSONVersionError, /Unsupported BSON version/i);
});

it('returns 8 bytes (+7 meta bytes) size for a bigint value', function () {
const doc = { a: BigInt(1) };
expect(BSON.calculateObjectSize(doc)).to.equal(16);
expect(BSON.calculateObjectSize(doc)).to.equal(BSON.serialize(doc).byteLength);
describe('bigint', function () {
beforeEach(function () {
if (BSON.__noBigInt__) {
this.currentTest?.skip();
}
});

it('returns 8 bytes (+7 meta bytes) size for a bigint value', function () {
const doc = { a: BigInt(1) };
expect(BSON.calculateObjectSize(doc)).to.equal(16);
expect(BSON.calculateObjectSize(doc)).to.equal(BSON.serialize(doc).byteLength);
});
});

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

0 comments on commit c2bfe36

Please sign in to comment.