File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,30 @@ describe('MONGODB-AWS', function () {
136136 } ) ;
137137 } ) ;
138138
139+ context ( 'when the AWS SDK is not present' , function ( ) {
140+ beforeEach ( function ( ) {
141+ if ( awsSdkPresent ) {
142+ this . skipReason = 'Tests error case when the AWS SDK is not installed.' ;
143+ return this . skip ( ) ;
144+ }
145+ } ) ;
146+
147+ describe ( 'when attempting AWS auth' , function ( ) {
148+ it ( 'throws an error' , async function ( ) {
149+ client = this . configuration . newClient ( process . env . MONGODB_URI ) ; // use the URI built by the test environment
150+
151+ const err = await client
152+ . db ( 'aws' )
153+ . collection ( 'aws_test' )
154+ . estimatedDocumentCount ( )
155+ . catch ( e => e ) ;
156+
157+ expect ( err ) . to . be . instanceof ( MongoServerError ) ;
158+ expect ( err . message ) . to . match ( / c r e d e n t i a l - p r o v i d e r s / ) ;
159+ } ) ;
160+ } ) ;
161+ } ) ;
162+
139163 context ( 'when user supplies a credentials provider' , function ( ) {
140164 let providerCount = 0 ;
141165
You can’t perform that action at this time.
0 commit comments