Skip to content

Commit 3ada791

Browse files
feat!: bump BSON_MAJOR_VERSION to 7 (#832)
1 parent c1a62a5 commit 3ada791

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @internal */
2-
export const BSON_MAJOR_VERSION = 6;
2+
export const BSON_MAJOR_VERSION = 7;
33

44
/** @internal */
55
export const BSON_VERSION_SYMBOL = Symbol.for('@@mdb.bson.version');

test/node/bson_type_classes.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ describe('BSON Type classes common interfaces', () => {
9898
));
9999
}
100100

101-
it(`defines a Symbol.for('@@mdb.bson.version') property equal to 6`, () =>
102-
expect(TypeClass.prototype).to.have.property(Symbol.for('@@mdb.bson.version'), 6));
101+
it(`defines a Symbol.for('@@mdb.bson.version') property equal to 7`, () =>
102+
expect(TypeClass.prototype).to.have.property(Symbol.for('@@mdb.bson.version'), 7));
103103

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

test/node/constants.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ import * as constants from '../../src/constants';
44

55
describe('BSON Constants', () => {
66
describe('.BSON_MAJOR_VERSION', () => {
7-
it('returns the current major version', () => {
8-
expect(constants.BSON_MAJOR_VERSION).to.equal(6);
7+
it('returns the current major version', async () => {
8+
const package_json = await import('../../package.json');
9+
const current_major = Number(package_json.version.split('.')[0]);
10+
expect(constants.BSON_MAJOR_VERSION).to.equal(current_major);
911
});
1012
});
1113

test/node/parser/serializer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe('serialize()', () => {
4848
// a nested invalid _bsontype throws something different
4949
expect(() =>
5050
BSON.serialize({
51-
a: { _bsontype: 'iLoveJavascript', [Symbol.for('@@mdb.bson.version')]: 6 }
51+
a: { _bsontype: 'iLoveJavascript', [Symbol.for('@@mdb.bson.version')]: 7 }
5252
})
5353
).to.throw(/invalid _bsontype/);
5454
});

0 commit comments

Comments
 (0)