From 1a335dc1fe927bbf3ce4234fb4c1ad8102ac17f2 Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Wed, 2 Aug 2023 14:01:08 +0200 Subject: [PATCH 1/2] feat(NODE-5504): bump bson major version --- src/constants.ts | 2 +- test/node/constants.test.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/constants.ts b/src/constants.ts index a56b8031..1311ef06 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,5 +1,5 @@ /** @internal */ -export const BSON_MAJOR_VERSION = 5 as const; +export const BSON_MAJOR_VERSION = 6 as const; /** @internal */ export const BSON_INT32_MAX = 0x7fffffff; diff --git a/test/node/constants.test.ts b/test/node/constants.test.ts index 03ef21d2..77d17e94 100644 --- a/test/node/constants.test.ts +++ b/test/node/constants.test.ts @@ -3,6 +3,12 @@ import { Binary } from '../register-bson'; import * as constants from '../../src/constants'; describe('BSON Constants', () => { + describe('.BSON_MAJOR_VERSION', () => { + it('returns the current major version', () => { + expect(constants.BSON_MAJOR_VERSION).to.equal(6); + }); + }); + context('Binary Subtype', () => { /* subtype ::= From 0eb12b1a702f3cbc5ce717a566dc8cf93ad025ba Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Thu, 3 Aug 2023 12:47:07 +0200 Subject: [PATCH 2/2] fix: tests --- test/node/bson_type_classes.test.ts | 4 ++-- test/node/parser/serializer.test.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/node/bson_type_classes.test.ts b/test/node/bson_type_classes.test.ts index 3d7c3497..7b9b2105 100644 --- a/test/node/bson_type_classes.test.ts +++ b/test/node/bson_type_classes.test.ts @@ -80,8 +80,8 @@ describe('BSON Type classes common interfaces', () => { )); } - it(`defines a Symbol.for('@@mdb.bson.version') property equal to 5`, () => - expect(TypeClass.prototype).to.have.property(Symbol.for('@@mdb.bson.version'), 5)); + it(`defines a Symbol.for('@@mdb.bson.version') property equal to 6`, () => + expect(TypeClass.prototype).to.have.property(Symbol.for('@@mdb.bson.version'), 6)); it(`defines a static fromExtendedJSON() method`, () => expect(TypeClass).to.have.property('fromExtendedJSON').that.is.a('function')); diff --git a/test/node/parser/serializer.test.ts b/test/node/parser/serializer.test.ts index d09c11b1..c06161cc 100644 --- a/test/node/parser/serializer.test.ts +++ b/test/node/parser/serializer.test.ts @@ -47,7 +47,7 @@ describe('serialize()', () => { // a nested invalid _bsontype throws something different expect(() => BSON.serialize({ - a: { _bsontype: 'iLoveJavascript', [Symbol.for('@@mdb.bson.version')]: 5 } + a: { _bsontype: 'iLoveJavascript', [Symbol.for('@@mdb.bson.version')]: 6 } }) ).to.throw(/invalid _bsontype/); });