|
1 | 1 | 'use strict';
|
2 | 2 | const BSON = require('bson');
|
3 |
| -const chai = require('chai'); |
| 3 | +const { expect } = require('chai'); |
4 | 4 | const fs = require('fs');
|
5 | 5 | const path = require('path');
|
| 6 | + |
6 | 7 | const { deadlockTests } = require('./client_side_encryption.prose.deadlock');
|
| 8 | +const { dropCollection, APMEventCollector } = require('../shared'); |
7 | 9 |
|
8 |
| -const expect = chai.expect; |
9 |
| -chai.use(require('chai-subset')); |
| 10 | +const { EJSON } = BSON; |
10 | 11 | const { LEGACY_HELLO_COMMAND } = require('../../../src/constants');
|
11 | 12 |
|
12 | 13 | const getKmsProviders = (localKey, kmipEndpoint, azureEndpoint, gcpEndpoint) => {
|
@@ -53,10 +54,6 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
|
53 | 54 | const keyVaultCollName = 'datakeys';
|
54 | 55 | const keyVaultNamespace = `${keyVaultDbName}.${keyVaultCollName}`;
|
55 | 56 |
|
56 |
| - const shared = require('../shared'); |
57 |
| - const dropCollection = shared.dropCollection; |
58 |
| - const APMEventCollector = shared.APMEventCollector; |
59 |
| - |
60 | 57 | const LOCAL_KEY = Buffer.from(
|
61 | 58 | 'Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk',
|
62 | 59 | 'base64'
|
@@ -337,9 +334,6 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
|
337 | 334 | // and confirming that the externalClient is firing off keyVault requests during
|
338 | 335 | // encrypted operations
|
339 | 336 | describe('External Key Vault Test', function () {
|
340 |
| - const fs = require('fs'); |
341 |
| - const path = require('path'); |
342 |
| - const { EJSON } = BSON; |
343 | 337 | function loadExternal(file) {
|
344 | 338 | return EJSON.parse(
|
345 | 339 | fs.readFileSync(path.resolve(__dirname, '../../spec/client-side-encryption/external', file))
|
@@ -541,9 +535,6 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
|
541 | 535 | });
|
542 | 536 |
|
543 | 537 | describe('BSON size limits and batch splitting', function () {
|
544 |
| - const fs = require('fs'); |
545 |
| - const path = require('path'); |
546 |
| - const { EJSON } = BSON; |
547 | 538 | function loadLimits(file) {
|
548 | 539 | return EJSON.parse(
|
549 | 540 | fs.readFileSync(path.resolve(__dirname, '../../spec/client-side-encryption/limits', file))
|
@@ -621,7 +612,7 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
|
621 | 612 | }
|
622 | 613 | });
|
623 | 614 |
|
624 |
| - after(function () { |
| 615 | + afterEach(function () { |
625 | 616 | return this.client && this.client.close();
|
626 | 617 | });
|
627 | 618 |
|
|
0 commit comments