Skip to content

Commit f454070

Browse files
committed
fix prose test, add unit test for nodeless
1 parent 7a2fda5 commit f454070

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

test/csfle-kms-providers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as process from 'process';
22

3-
import { type KMSProviders } from './mongodb';
3+
import { type KMSProviders } from './mongodb_runtime-testing';
44

55
const csfleKMSProviders = {
66
aws: {

test/integration/client-side-encryption/client_side_encryption.prose.21.automatic_data_encryption_keys.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
MongoCryptCreateEncryptedCollectionError,
1313
MongoServerError
1414
} from '../../mongodb_runtime-testing';
15+
import { ensureTypeByName } from '../../tools/utils';
1516
const metadata: MongoDBMetadataUI = {
1617
requires: {
1718
clientSideEncryption: true,
@@ -94,7 +95,7 @@ describe('21. Automatic Data Encryption Keys', () => {
9495
})
9596
.catch(error => error);
9697

97-
expect(result).to.be.instanceOf(TypeError);
98+
ensureTypeByName(result, 'TypeError');
9899
});
99100

100101
it('Case 3: Invalid keyId', metadata, async () => {

test/unit/nodeless.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { expect } from 'chai';
2+
import { env } from 'process';
3+
4+
import { runNodelessTests } from '../mongodb_runtime-testing';
5+
6+
describe('Nodeless tests', function () {
7+
it('runNodelessTests variable should match env vars', function () {
8+
const nodelessEnv = env.NODELESS;
9+
const expectedNodeless = nodelessEnv === 'true';
10+
const actualNodeless = runNodelessTests;
11+
expect(actualNodeless).to.equal(
12+
expectedNodeless,
13+
"runNodelessTests variable does not match NODELESS env var, run 'npm run build:runtime-barrel' to update the barrel file"
14+
);
15+
});
16+
});

0 commit comments

Comments
 (0)