1- 'use strict ';
1+ import { expect } from 'chai ';
22
3- const mock = require ( '../../tools/mongodb-mock/index' ) ;
4- const { expect } = require ( 'chai' ) ;
5- const { MongoServerSelectionError, MongoClient } = require ( '../../mongodb' ) ;
6- const { isHello } = require ( '../../mongodb' ) ;
3+ import {
4+ isHello ,
5+ MAX_SUPPORTED_WIRE_VERSION ,
6+ MIN_SUPPORTED_WIRE_VERSION ,
7+ MongoClient ,
8+ MongoServerSelectionError
9+ } from '../../mongodb' ;
10+ import * as mock from '../../tools/mongodb-mock/index' ;
711
812const minCompatErrMsg = `minimum wire version ${
913 Number . MAX_SAFE_INTEGER - 1
10- } , but this version of the Node.js Driver requires at most 21 `;
11- const maxCompatErrMsg = `reports maximum wire version 1, but this version of the Node.js Driver requires at least 6 ` ;
14+ } , but this version of the Node.js Driver requires at most ${ MAX_SUPPORTED_WIRE_VERSION } `;
15+ const maxCompatErrMsg = `reports maximum wire version 1, but this version of the Node.js Driver requires at least ${ MIN_SUPPORTED_WIRE_VERSION } ` ;
1216
1317describe ( 'Wire Protocol Version' , ( ) => {
14- /** @type {mock.MockServer } */
15- let server , client ;
18+ let server , client : MongoClient ;
1619
1720 function setWireProtocolMessageHandler ( min , max ) {
1821 server . setMessageHandler ( req => {
@@ -41,7 +44,6 @@ describe('Wire Protocol Version', () => {
4144 it ( 'should raise a compatibility error' , async function ( ) {
4245 setWireProtocolMessageHandler ( Number . MAX_SAFE_INTEGER - 1 , Number . MAX_SAFE_INTEGER ) ;
4346
44- /** @type {MongoClient } */
4547 client = new MongoClient (
4648 `mongodb://${ server . uri ( ) } /wireVersionTest?serverSelectionTimeoutMS=200`
4749 ) ;
@@ -59,7 +61,6 @@ describe('Wire Protocol Version', () => {
5961 it ( 'should raise a compatibility error' , async function ( ) {
6062 setWireProtocolMessageHandler ( 1 , 1 ) ;
6163
62- /** @type {MongoClient } */
6364 client = new MongoClient (
6465 `mongodb://${ server . uri ( ) } /wireVersionTest?serverSelectionTimeoutMS=200`
6566 ) ;
0 commit comments