Skip to content

Commit b6d9090

Browse files
committed
fix: before all hooks run regardless of test skip, new hazzard?
1 parent 0ca754b commit b6d9090

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

test/integration/client-side-encryption/client_side_encryption.prose.test.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -552,14 +552,16 @@ describe('Client Side Encryption Prose Tests', function () {
552552
const limitsKey = loadLimits('limits-key.json');
553553
const limitsDoc = loadLimits('limits-doc.json');
554554

555-
before(function () {
556-
// First, perform the setup.
555+
let firstTimeSetup = true;
556+
beforeEach(async function () {
557+
if (firstTimeSetup) {
558+
firstTimeSetup = false;
559+
// First, perform the setup.
557560

558-
// #. Create a MongoClient without encryption enabled (referred to as ``client``).
559-
this.client = this.configuration.newClient();
561+
// #. Create a MongoClient without encryption enabled (referred to as ``client``).
562+
this.client = this.configuration.newClient();
560563

561-
return (
562-
this.client
564+
await this.client
563565
.connect()
564566
// #. Using ``client``, drop and create the collection ``db.coll`` configured with the included JSON schema `limits/limits-schema.json <../limits/limits-schema.json>`_.
565567
.then(() => dropCollection(this.client.db(dataDbName), dataCollName))
@@ -575,11 +577,9 @@ describe('Client Side Encryption Prose Tests', function () {
575577
.db(keyVaultDbName)
576578
.collection(keyVaultCollName)
577579
.insertOne(limitsKey, { writeConcern: { w: 'majority' } });
578-
})
579-
);
580-
});
580+
});
581+
}
581582

582-
beforeEach(function () {
583583
// #. Create a MongoClient configured with auto encryption (referred to as ``client_encrypted``)
584584
// Configure with the ``local`` KMS provider as follows:
585585
// .. code:: javascript

test/tools/runner/filters/client_encryption_filter.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22

33
const mongodb = require('../../../../src');
4-
const semver = require('semver');
54

65
/**
76
* Filter for whether or not a test needs / doesn't need Client Side Encryption
@@ -40,11 +39,7 @@ class ClientSideEncryptionFilter {
4039
const clientSideEncryption =
4140
test.metadata && test.metadata.requires && test.metadata.requires.clientSideEncryption;
4241

43-
// CSFLE is only supported on LTS versions of node
44-
const nodeSupportsCSFLE = semver.satisfies(process.version, '>4');
45-
46-
const ret = typeof clientSideEncryption !== 'boolean' || clientSideEncryption === this.enabled;
47-
return ret && nodeSupportsCSFLE;
42+
return typeof clientSideEncryption !== 'boolean' || clientSideEncryption === this.enabled;
4843
}
4944
}
5045

0 commit comments

Comments
 (0)