@@ -2,7 +2,7 @@ import { expect } from 'chai';
2
2
import type { Db , Document , MongoClientOptions } from 'mongodb' ;
3
3
import { MongoClient } from 'mongodb' ;
4
4
import { eventually } from '../../../testing/eventually' ;
5
- import { TestShell } from './test-shell' ;
5
+ import type { TestShell } from './test-shell' ;
6
6
import {
7
7
skipIfApiStrict ,
8
8
startSharedTestServer ,
@@ -110,7 +110,7 @@ describe('Auth e2e', function () {
110
110
beforeEach ( async function ( ) {
111
111
const connectionString = await testServer . connectionString ( ) ;
112
112
dbName = `test-${ Date . now ( ) } ` ;
113
- shell = TestShell . start ( { args : [ connectionString ] } ) ;
113
+ shell = this . startTestShell ( { args : [ connectionString ] } ) ;
114
114
115
115
client = await MongoClient . connect ( connectionString , { } ) ;
116
116
@@ -137,7 +137,6 @@ describe('Auth e2e', function () {
137
137
138
138
await client . close ( ) ;
139
139
} ) ;
140
- afterEach ( TestShell . cleanup ) ;
141
140
142
141
describe ( 'user management' , function ( ) {
143
142
describe ( 'createUser' , function ( ) {
@@ -879,7 +878,7 @@ describe('Auth e2e', function () {
879
878
pathname : `/${ dbName } ` ,
880
879
}
881
880
) ;
882
- shell = TestShell . start ( { args : [ authConnectionString ] } ) ;
881
+ shell = this . startTestShell ( { args : [ authConnectionString ] } ) ;
883
882
await shell . waitForPrompt ( ) ;
884
883
shell . assertNoErrors ( ) ;
885
884
await shell . executeLine ( `use ${ dbName } ` ) ;
@@ -903,7 +902,7 @@ describe('Auth e2e', function () {
903
902
pathname : `/${ dbName } ` ,
904
903
}
905
904
) ;
906
- shell = TestShell . start ( { args : [ authConnectionString ] } ) ;
905
+ shell = this . startTestShell ( { args : [ authConnectionString ] } ) ;
907
906
await shell . waitForPrompt ( ) ;
908
907
shell . assertNoErrors ( ) ;
909
908
await shell . executeLine ( `use ${ dbName } ` ) ;
@@ -930,7 +929,7 @@ describe('Auth e2e', function () {
930
929
} ) ;
931
930
it ( 'can auth when there is -u and -p' , async function ( ) {
932
931
const connectionString = await testServer . connectionString ( ) ;
933
- shell = TestShell . start ( {
932
+ shell = this . startTestShell ( {
934
933
args : [
935
934
connectionString ,
936
935
'-u' ,
@@ -965,7 +964,7 @@ describe('Auth e2e', function () {
965
964
return this . skip ( ) ; // No SCRAM-SHA-1 in FIPS mode
966
965
}
967
966
const connectionString = await testServer . connectionString ( ) ;
968
- shell = TestShell . start ( {
967
+ shell = this . startTestShell ( {
969
968
args : [
970
969
connectionString ,
971
970
'-u' ,
@@ -989,7 +988,7 @@ describe('Auth e2e', function () {
989
988
// This test is not particularly meaningful if we're using the system OpenSSL installation
990
989
// and it is not properly configured for FIPS to begin with. This is the case on e.g.
991
990
// Ubuntu 22.04 in evergreen CI.
992
- const preTestShell = TestShell . start ( {
991
+ const preTestShell = this . startTestShell ( {
993
992
args : [
994
993
'--quiet' ,
995
994
'--nodb' ,
@@ -1009,7 +1008,7 @@ describe('Auth e2e', function () {
1009
1008
}
1010
1009
1011
1010
const connectionString = await testServer . connectionString ( ) ;
1012
- shell = TestShell . start ( {
1011
+ shell = this . startTestShell ( {
1013
1012
args : [
1014
1013
connectionString ,
1015
1014
'--tlsFIPSMode' ,
@@ -1034,7 +1033,7 @@ describe('Auth e2e', function () {
1034
1033
} ) ;
1035
1034
it ( 'can auth with SCRAM-SHA-256' , async function ( ) {
1036
1035
const connectionString = await testServer . connectionString ( ) ;
1037
- shell = TestShell . start ( {
1036
+ shell = this . startTestShell ( {
1038
1037
args : [
1039
1038
connectionString ,
1040
1039
'-u' ,
@@ -1055,7 +1054,7 @@ describe('Auth e2e', function () {
1055
1054
} ) ;
1056
1055
it ( 'cannot auth when authenticationMechanism mismatches (sha256 -> sha1)' , async function ( ) {
1057
1056
const connectionString = await testServer . connectionString ( ) ;
1058
- shell = TestShell . start ( {
1057
+ shell = this . startTestShell ( {
1059
1058
args : [
1060
1059
connectionString ,
1061
1060
'-u' ,
@@ -1076,7 +1075,7 @@ describe('Auth e2e', function () {
1076
1075
} ) ;
1077
1076
it ( 'cannot auth when authenticationMechanism mismatches (sha1 -> sha256)' , async function ( ) {
1078
1077
const connectionString = await testServer . connectionString ( ) ;
1079
- shell = TestShell . start ( {
1078
+ shell = this . startTestShell ( {
1080
1079
args : [
1081
1080
connectionString ,
1082
1081
'-u' ,
@@ -1097,7 +1096,7 @@ describe('Auth e2e', function () {
1097
1096
} ) ;
1098
1097
it ( 'does not fail with kerberos not found for GSSAPI' , async function ( ) {
1099
1098
const connectionString = await testServer . connectionString ( ) ;
1100
- shell = TestShell . start ( {
1099
+ shell = this . startTestShell ( {
1101
1100
args : [
1102
1101
connectionString ,
1103
1102
'-u' ,
@@ -1144,6 +1143,5 @@ describe('Auth e2e', function () {
1144
1143
1145
1144
await client . close ( ) ;
1146
1145
} ) ;
1147
- afterEach ( TestShell . cleanup ) ;
1148
1146
} ) ;
1149
1147
} ) ;
0 commit comments