Skip to content

Commit 9615902

Browse files
authored
feat(NODE-5504)!: bump bson major version (#605)
1 parent 409c592 commit 9615902

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

src/constants.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @internal */
2-
export const BSON_MAJOR_VERSION = 5 as const;
2+
export const BSON_MAJOR_VERSION = 6 as const;
33

44
/** @internal */
55
export const BSON_INT32_MAX = 0x7fffffff;

test/node/bson_type_classes.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ describe('BSON Type classes common interfaces', () => {
8080
));
8181
}
8282

83-
it(`defines a Symbol.for('@@mdb.bson.version') property equal to 5`, () =>
84-
expect(TypeClass.prototype).to.have.property(Symbol.for('@@mdb.bson.version'), 5));
83+
it(`defines a Symbol.for('@@mdb.bson.version') property equal to 6`, () =>
84+
expect(TypeClass.prototype).to.have.property(Symbol.for('@@mdb.bson.version'), 6));
8585

8686
it(`defines a static fromExtendedJSON() method`, () =>
8787
expect(TypeClass).to.have.property('fromExtendedJSON').that.is.a('function'));

test/node/constants.test.ts

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ import { Binary } from '../register-bson';
33
import * as constants from '../../src/constants';
44

55
describe('BSON Constants', () => {
6+
describe('.BSON_MAJOR_VERSION', () => {
7+
it('returns the current major version', () => {
8+
expect(constants.BSON_MAJOR_VERSION).to.equal(6);
9+
});
10+
});
11+
612
context('Binary Subtype', () => {
713
/*
814
subtype ::=

test/node/parser/serializer.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('serialize()', () => {
4747
// a nested invalid _bsontype throws something different
4848
expect(() =>
4949
BSON.serialize({
50-
a: { _bsontype: 'iLoveJavascript', [Symbol.for('@@mdb.bson.version')]: 5 }
50+
a: { _bsontype: 'iLoveJavascript', [Symbol.for('@@mdb.bson.version')]: 6 }
5151
})
5252
).to.throw(/invalid _bsontype/);
5353
});

0 commit comments

Comments
 (0)