@@ -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 { cleanTestShellsAfterEach , TestShell } from './test-shell' ;
5+ import type { TestShell } from './test-shell' ;
66import {
77 skipIfApiStrict ,
88 startSharedTestServer ,
@@ -107,12 +107,10 @@ describe('Auth e2e', function () {
107107 let examplePrivilege2 : Document ;
108108
109109 describe ( 'with regular URI' , function ( ) {
110- cleanTestShellsAfterEach ( ) ;
111-
112110 beforeEach ( async function ( ) {
113111 const connectionString = await testServer . connectionString ( ) ;
114112 dbName = `test-${ Date . now ( ) } ` ;
115- shell = TestShell . start ( { args : [ connectionString ] } ) ;
113+ shell = this . startTestShell ( { args : [ connectionString ] } ) ;
116114
117115 client = await MongoClient . connect ( connectionString , { } ) ;
118116
@@ -880,7 +878,7 @@ describe('Auth e2e', function () {
880878 pathname : `/${ dbName } ` ,
881879 }
882880 ) ;
883- shell = TestShell . start ( { args : [ authConnectionString ] } ) ;
881+ shell = this . startTestShell ( { args : [ authConnectionString ] } ) ;
884882 await shell . waitForPrompt ( ) ;
885883 shell . assertNoErrors ( ) ;
886884 await shell . executeLine ( `use ${ dbName } ` ) ;
@@ -904,7 +902,7 @@ describe('Auth e2e', function () {
904902 pathname : `/${ dbName } ` ,
905903 }
906904 ) ;
907- shell = TestShell . start ( { args : [ authConnectionString ] } ) ;
905+ shell = this . startTestShell ( { args : [ authConnectionString ] } ) ;
908906 await shell . waitForPrompt ( ) ;
909907 shell . assertNoErrors ( ) ;
910908 await shell . executeLine ( `use ${ dbName } ` ) ;
@@ -931,7 +929,7 @@ describe('Auth e2e', function () {
931929 } ) ;
932930 it ( 'can auth when there is -u and -p' , async function ( ) {
933931 const connectionString = await testServer . connectionString ( ) ;
934- shell = TestShell . start ( {
932+ shell = this . startTestShell ( {
935933 args : [
936934 connectionString ,
937935 '-u' ,
@@ -966,7 +964,7 @@ describe('Auth e2e', function () {
966964 return this . skip ( ) ; // No SCRAM-SHA-1 in FIPS mode
967965 }
968966 const connectionString = await testServer . connectionString ( ) ;
969- shell = TestShell . start ( {
967+ shell = this . startTestShell ( {
970968 args : [
971969 connectionString ,
972970 '-u' ,
@@ -990,7 +988,7 @@ describe('Auth e2e', function () {
990988 // This test is not particularly meaningful if we're using the system OpenSSL installation
991989 // and it is not properly configured for FIPS to begin with. This is the case on e.g.
992990 // Ubuntu 22.04 in evergreen CI.
993- const preTestShell = TestShell . start ( {
991+ const preTestShell = this . startTestShell ( {
994992 args : [
995993 '--quiet' ,
996994 '--nodb' ,
@@ -1010,7 +1008,7 @@ describe('Auth e2e', function () {
10101008 }
10111009
10121010 const connectionString = await testServer . connectionString ( ) ;
1013- shell = TestShell . start ( {
1011+ shell = this . startTestShell ( {
10141012 args : [
10151013 connectionString ,
10161014 '--tlsFIPSMode' ,
@@ -1035,7 +1033,7 @@ describe('Auth e2e', function () {
10351033 } ) ;
10361034 it ( 'can auth with SCRAM-SHA-256' , async function ( ) {
10371035 const connectionString = await testServer . connectionString ( ) ;
1038- shell = TestShell . start ( {
1036+ shell = this . startTestShell ( {
10391037 args : [
10401038 connectionString ,
10411039 '-u' ,
@@ -1056,7 +1054,7 @@ describe('Auth e2e', function () {
10561054 } ) ;
10571055 it ( 'cannot auth when authenticationMechanism mismatches (sha256 -> sha1)' , async function ( ) {
10581056 const connectionString = await testServer . connectionString ( ) ;
1059- shell = TestShell . start ( {
1057+ shell = this . startTestShell ( {
10601058 args : [
10611059 connectionString ,
10621060 '-u' ,
@@ -1077,7 +1075,7 @@ describe('Auth e2e', function () {
10771075 } ) ;
10781076 it ( 'cannot auth when authenticationMechanism mismatches (sha1 -> sha256)' , async function ( ) {
10791077 const connectionString = await testServer . connectionString ( ) ;
1080- shell = TestShell . start ( {
1078+ shell = this . startTestShell ( {
10811079 args : [
10821080 connectionString ,
10831081 '-u' ,
@@ -1098,7 +1096,7 @@ describe('Auth e2e', function () {
10981096 } ) ;
10991097 it ( 'does not fail with kerberos not found for GSSAPI' , async function ( ) {
11001098 const connectionString = await testServer . connectionString ( ) ;
1101- shell = TestShell . start ( {
1099+ shell = this . startTestShell ( {
11021100 args : [
11031101 connectionString ,
11041102 '-u' ,
@@ -1145,7 +1143,5 @@ describe('Auth e2e', function () {
11451143
11461144 await client . close ( ) ;
11471145 } ) ;
1148-
1149- cleanTestShellsAfterEach ( ) ;
11501146 } ) ;
11511147} ) ;
0 commit comments