Skip to content

Commit

Permalink
feat(NODE-5504)!: bump bson major version (#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
durran authored Aug 3, 2023
1 parent 409c592 commit 9615902
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
4 changes: 2 additions & 2 deletions test/node/bson_type_classes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
6 changes: 6 additions & 0 deletions test/node/constants.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ::=
Expand Down
2 changes: 1 addition & 1 deletion test/node/parser/serializer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/);
});
Expand Down

0 comments on commit 9615902

Please sign in to comment.