From 9615902943927646562c145604fc477cd42e9ce6 Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Thu, 3 Aug 2023 15:49:06 +0200 Subject: [PATCH] feat(NODE-5504)!: bump bson major version (#605) --- src/constants.ts | 2 +- test/node/bson_type_classes.test.ts | 4 ++-- test/node/constants.test.ts | 6 ++++++ test/node/parser/serializer.test.ts | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) 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/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/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 ::= 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/); });