ext/libmongocrypt/libmongocrypt/bindings/node/test/autoEncrypter.test.js in libmongocrypt-helper-1.7.4.0.1002 vs ext/libmongocrypt/libmongocrypt/bindings/node/test/autoEncrypter.test.js in libmongocrypt-helper-1.8.0.0.1001
- old
+ new
@@ -11,14 +11,11 @@
const MongoError = mongodb.MongoError;
const stateMachine = require('../lib/stateMachine')({ mongodb });
const StateMachine = stateMachine.StateMachine;
const MongocryptdManager = require('../lib/mongocryptdManager').MongocryptdManager;
-const chai = require('chai');
-const expect = chai.expect;
-chai.use(require('chai-subset'));
-chai.use(require('sinon-chai'));
+const { expect } = require('chai');
const sharedLibrarySuffix =
process.platform === 'win32' ? 'dll' : process.platform === 'darwin' ? 'dylib' : 'so';
let sharedLibraryStub = path.resolve(
__dirname,
@@ -101,11 +98,11 @@
callback(null, MOCK_MONGOCRYPTD_RESPONSE);
});
sandbox.stub(StateMachine.prototype, 'fetchKeys').callsFake((client, ns, filter, callback) => {
- // mock data is already seriaized, our action deals with the result of a cursor
+ // mock data is already serialized, our action deals with the result of a cursor
const deserializedKey = BSON.deserialize(MOCK_KEYDOCUMENT_RESPONSE);
callback(null, [deserializedKey]);
});
});
@@ -369,11 +366,11 @@
context('when no refresh function is provided', function () {
const accessKey = 'example';
const secretKey = 'example';
before(function () {
- if (process.env.NPM_OPTIONS === '--no-optional') {
+ if (!requirements.credentialProvidersInstalled.aws) {
this.currentTest.skipReason = 'Cannot refresh credentials without sdk provider';
this.currentTest.skip();
return;
}
// After the entire suite runs, set the env back for the rest of the test run.
@@ -408,10 +405,10 @@
context('when no refresh function is provided and no optional sdk', function () {
const accessKey = 'example';
const secretKey = 'example';
before(function () {
- if (!process.env.NPM_OPTIONS) {
+ if (requirements.credentialProvidersInstalled.aws) {
this.currentTest.skipReason = 'With optional sdk installed credentials would be loaded.';
this.currentTest.skip();
return;
}
// After the entire suite runs, set the env back for the rest of the test run.