diff --git a/src/cmap/wire_protocol/constants.ts b/src/cmap/wire_protocol/constants.ts index b62cdc90c5..9512993798 100644 --- a/src/cmap/wire_protocol/constants.ts +++ b/src/cmap/wire_protocol/constants.ts @@ -1,7 +1,7 @@ export const MIN_SUPPORTED_SERVER_VERSION = '3.6'; -export const MAX_SUPPORTED_SERVER_VERSION = '7.0'; +export const MAX_SUPPORTED_SERVER_VERSION = '8.0'; export const MIN_SUPPORTED_WIRE_VERSION = 6; -export const MAX_SUPPORTED_WIRE_VERSION = 21; +export const MAX_SUPPORTED_WIRE_VERSION = 25; export const MIN_SUPPORTED_QE_WIRE_VERSION = 21; export const MIN_SUPPORTED_QE_SERVER_VERSION = '7.0'; export const OP_REPLY = 1; diff --git a/test/unit/assorted/wire_version.test.js b/test/unit/assorted/wire_version.test.ts similarity index 80% rename from test/unit/assorted/wire_version.test.js rename to test/unit/assorted/wire_version.test.ts index 8e8e6c6176..448622ce20 100644 --- a/test/unit/assorted/wire_version.test.js +++ b/test/unit/assorted/wire_version.test.ts @@ -1,18 +1,21 @@ -'use strict'; +import { expect } from 'chai'; -const mock = require('../../tools/mongodb-mock/index'); -const { expect } = require('chai'); -const { MongoServerSelectionError, MongoClient } = require('../../mongodb'); -const { isHello } = require('../../mongodb'); +import { + isHello, + MAX_SUPPORTED_WIRE_VERSION, + MIN_SUPPORTED_WIRE_VERSION, + MongoClient, + MongoServerSelectionError +} from '../../mongodb'; +import * as mock from '../../tools/mongodb-mock/index'; const minCompatErrMsg = `minimum wire version ${ Number.MAX_SAFE_INTEGER - 1 -}, but this version of the Node.js Driver requires at most 21`; -const maxCompatErrMsg = `reports maximum wire version 1, but this version of the Node.js Driver requires at least 6`; +}, but this version of the Node.js Driver requires at most ${MAX_SUPPORTED_WIRE_VERSION}`; +const maxCompatErrMsg = `reports maximum wire version 1, but this version of the Node.js Driver requires at least ${MIN_SUPPORTED_WIRE_VERSION}`; describe('Wire Protocol Version', () => { - /** @type {mock.MockServer} */ - let server, client; + let server, client: MongoClient; function setWireProtocolMessageHandler(min, max) { server.setMessageHandler(req => { @@ -41,7 +44,6 @@ describe('Wire Protocol Version', () => { it('should raise a compatibility error', async function () { setWireProtocolMessageHandler(Number.MAX_SAFE_INTEGER - 1, Number.MAX_SAFE_INTEGER); - /** @type {MongoClient} */ client = new MongoClient( `mongodb://${server.uri()}/wireVersionTest?serverSelectionTimeoutMS=200` ); @@ -59,7 +61,6 @@ describe('Wire Protocol Version', () => { it('should raise a compatibility error', async function () { setWireProtocolMessageHandler(1, 1); - /** @type {MongoClient} */ client = new MongoClient( `mongodb://${server.uri()}/wireVersionTest?serverSelectionTimeoutMS=200` ); diff --git a/test/unit/cmap/wire_protocol/constants.test.js b/test/unit/cmap/wire_protocol/constants.test.ts similarity index 64% rename from test/unit/cmap/wire_protocol/constants.test.js rename to test/unit/cmap/wire_protocol/constants.test.ts index 7f03b8a0c9..81fb1e8106 100644 --- a/test/unit/cmap/wire_protocol/constants.test.js +++ b/test/unit/cmap/wire_protocol/constants.test.ts @@ -1,10 +1,11 @@ -const { expect } = require('chai'); -const { - MIN_SUPPORTED_SERVER_VERSION, +import { expect } from 'chai'; + +import { MAX_SUPPORTED_SERVER_VERSION, - MIN_SUPPORTED_WIRE_VERSION, - MAX_SUPPORTED_WIRE_VERSION -} = require('../../../mongodb'); + MAX_SUPPORTED_WIRE_VERSION, + MIN_SUPPORTED_SERVER_VERSION, + MIN_SUPPORTED_WIRE_VERSION +} from '../../../mongodb'; describe('Wire Protocol Constants', function () { describe('MIN_SUPPORTED_SERVER_VERSION', function () { @@ -14,8 +15,8 @@ describe('Wire Protocol Constants', function () { }); describe('MAX_SUPPORTED_SERVER_VERSION', function () { - it('returns 7.0', function () { - expect(MAX_SUPPORTED_SERVER_VERSION).to.equal('7.0'); + it('returns 8.0', function () { + expect(MAX_SUPPORTED_SERVER_VERSION).to.equal('8.0'); }); }); @@ -26,8 +27,8 @@ describe('Wire Protocol Constants', function () { }); describe('MAX_SUPPORTED_WIRE_VERSION', function () { - it('returns 21', function () { - expect(MAX_SUPPORTED_WIRE_VERSION).to.equal(21); + it('returns 25', function () { + expect(MAX_SUPPORTED_WIRE_VERSION).to.equal(25); }); }); });