@@ -2,7 +2,7 @@ import { expect } from 'chai';
22import type { Db , Document , MongoClientOptions } from 'mongodb' ;
33import { MongoClient } from 'mongodb' ;
44import { eventually } from '../../../testing/eventually' ;
5- import { TestShell } from './test-shell' ;
5+ import type { TestShell } from './test-shell' ;
66import {
77 skipIfApiStrict ,
88 startSharedTestServer ,
@@ -110,7 +110,7 @@ describe('Auth e2e', function () {
110110 beforeEach ( async function ( ) {
111111 const connectionString = await testServer . connectionString ( ) ;
112112 dbName = `test-${ Date . now ( ) } ` ;
113- shell = TestShell . start ( { args : [ connectionString ] } ) ;
113+ shell = this . startTestShell ( { args : [ connectionString ] } ) ;
114114
115115 client = await MongoClient . connect ( connectionString , { } ) ;
116116
@@ -137,7 +137,6 @@ describe('Auth e2e', function () {
137137
138138 await client . close ( ) ;
139139 } ) ;
140- afterEach ( TestShell . cleanup ) ;
141140
142141 describe ( 'user management' , function ( ) {
143142 describe ( 'createUser' , function ( ) {
@@ -879,7 +878,7 @@ describe('Auth e2e', function () {
879878 pathname : `/${ dbName } ` ,
880879 }
881880 ) ;
882- shell = TestShell . start ( { args : [ authConnectionString ] } ) ;
881+ shell = this . startTestShell ( { args : [ authConnectionString ] } ) ;
883882 await shell . waitForPrompt ( ) ;
884883 shell . assertNoErrors ( ) ;
885884 await shell . executeLine ( `use ${ dbName } ` ) ;
@@ -903,7 +902,7 @@ describe('Auth e2e', function () {
903902 pathname : `/${ dbName } ` ,
904903 }
905904 ) ;
906- shell = TestShell . start ( { args : [ authConnectionString ] } ) ;
905+ shell = this . startTestShell ( { args : [ authConnectionString ] } ) ;
907906 await shell . waitForPrompt ( ) ;
908907 shell . assertNoErrors ( ) ;
909908 await shell . executeLine ( `use ${ dbName } ` ) ;
@@ -930,7 +929,7 @@ describe('Auth e2e', function () {
930929 } ) ;
931930 it ( 'can auth when there is -u and -p' , async function ( ) {
932931 const connectionString = await testServer . connectionString ( ) ;
933- shell = TestShell . start ( {
932+ shell = this . startTestShell ( {
934933 args : [
935934 connectionString ,
936935 '-u' ,
@@ -965,7 +964,7 @@ describe('Auth e2e', function () {
965964 return this . skip ( ) ; // No SCRAM-SHA-1 in FIPS mode
966965 }
967966 const connectionString = await testServer . connectionString ( ) ;
968- shell = TestShell . start ( {
967+ shell = this . startTestShell ( {
969968 args : [
970969 connectionString ,
971970 '-u' ,
@@ -989,7 +988,7 @@ describe('Auth e2e', function () {
989988 // This test is not particularly meaningful if we're using the system OpenSSL installation
990989 // and it is not properly configured for FIPS to begin with. This is the case on e.g.
991990 // Ubuntu 22.04 in evergreen CI.
992- const preTestShell = TestShell . start ( {
991+ const preTestShell = this . startTestShell ( {
993992 args : [
994993 '--quiet' ,
995994 '--nodb' ,
@@ -1009,7 +1008,7 @@ describe('Auth e2e', function () {
10091008 }
10101009
10111010 const connectionString = await testServer . connectionString ( ) ;
1012- shell = TestShell . start ( {
1011+ shell = this . startTestShell ( {
10131012 args : [
10141013 connectionString ,
10151014 '--tlsFIPSMode' ,
@@ -1034,7 +1033,7 @@ describe('Auth e2e', function () {
10341033 } ) ;
10351034 it ( 'can auth with SCRAM-SHA-256' , async function ( ) {
10361035 const connectionString = await testServer . connectionString ( ) ;
1037- shell = TestShell . start ( {
1036+ shell = this . startTestShell ( {
10381037 args : [
10391038 connectionString ,
10401039 '-u' ,
@@ -1055,7 +1054,7 @@ describe('Auth e2e', function () {
10551054 } ) ;
10561055 it ( 'cannot auth when authenticationMechanism mismatches (sha256 -> sha1)' , async function ( ) {
10571056 const connectionString = await testServer . connectionString ( ) ;
1058- shell = TestShell . start ( {
1057+ shell = this . startTestShell ( {
10591058 args : [
10601059 connectionString ,
10611060 '-u' ,
@@ -1076,7 +1075,7 @@ describe('Auth e2e', function () {
10761075 } ) ;
10771076 it ( 'cannot auth when authenticationMechanism mismatches (sha1 -> sha256)' , async function ( ) {
10781077 const connectionString = await testServer . connectionString ( ) ;
1079- shell = TestShell . start ( {
1078+ shell = this . startTestShell ( {
10801079 args : [
10811080 connectionString ,
10821081 '-u' ,
@@ -1097,7 +1096,7 @@ describe('Auth e2e', function () {
10971096 } ) ;
10981097 it ( 'does not fail with kerberos not found for GSSAPI' , async function ( ) {
10991098 const connectionString = await testServer . connectionString ( ) ;
1100- shell = TestShell . start ( {
1099+ shell = this . startTestShell ( {
11011100 args : [
11021101 connectionString ,
11031102 '-u' ,
@@ -1144,6 +1143,5 @@ describe('Auth e2e', function () {
11441143
11451144 await client . close ( ) ;
11461145 } ) ;
1147- afterEach ( TestShell . cleanup ) ;
11481146 } ) ;
11491147} ) ;
0 commit comments