Skip to content

Commit 7bd8b9a

Browse files
committed
swapped files to remove all import changes, got most non-integ tests passing, in addition to all integ tests
1 parent f454070 commit 7bd8b9a

169 files changed

Lines changed: 491 additions & 419 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

etc/build-runtime-barrel.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ const useBundled = process.env.MONGODB_BUNDLED === 'true';
77

88
const __dirname = path.dirname(fileURLToPath(import.meta.url));
99
const rootDir = path.join(__dirname, '..');
10-
const outputBarrelFile = path.join(rootDir, 'test/mongodb_runtime-testing.ts');
11-
const source = useBundled ? './mongodb_bundled' : './mongodb';
10+
const outputBarrelFile = path.join(rootDir, 'test/mongodb.ts');
11+
const source = useBundled ? './mongodb_bundled' : './mongodb_all';
1212

1313
const contents =
1414
`// This file is auto-generated. Do not edit.\n` +

etc/bundle-driver.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ await fs.rm(outdir, { recursive: true, force: true });
1414

1515
const outputBundleFile = path.join(outdir, 'driver-bundle.js');
1616
await esbuild.build({
17-
entryPoints: [path.join(rootDir, 'test/mongodb.ts')],
17+
entryPoints: [path.join(rootDir, 'test/mongodb_all.ts')],
1818
bundle: true,
1919
outfile: outputBundleFile,
2020
platform: 'node',

src/client-side-encryption/providers/azure.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@ export async function fetchAzureKMSToken(
163163
const response = await get(url, { headers });
164164
return await parseResponse(response);
165165
} catch (error) {
166-
if (error instanceof MongoNetworkTimeoutError) {
166+
if (
167+
error instanceof MongoNetworkTimeoutError ||
168+
(error && error.constructor && error.constructor.name === 'MongoNetworkTimeoutError')
169+
) {
167170
throw new MongoCryptAzureKMSRequestError(`[Azure KMS] ${error.message}`);
168171
}
169172
throw error;

src/operations/client_bulk_write/command_builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ function validateBufferSize(name: string, buffer: Uint8Array, maxBsonObjectSize:
242242
}
243243

244244
/** @internal */
245-
interface ClientInsertOperation {
245+
export interface ClientInsertOperation {
246246
insert: number;
247247
document: OptionalId<Document>;
248248
}

test/action/dependency.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as path from 'node:path';
55
import { expect } from 'chai';
66

77
import { dependencies, peerDependencies, peerDependenciesMeta } from '../../package.json';
8-
import { setDifference } from '../mongodb_runtime-testing';
8+
import { setDifference } from '../mongodb';
99
import { alphabetically, itInNodeProcess, sorted } from '../tools/utils';
1010

1111
const EXPECTED_DEPENDENCIES = sorted(

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_runtime-testing';
3+
import { type KMSProviders } from './mongodb_all';
44

55
const csfleKMSProviders = {
66
aws: {

test/integration/auth/auth.prose.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@ import { expect } from 'chai';
22
import * as process from 'process';
33
import * as sinon from 'sinon';
44

5-
import {
6-
Connection,
7-
LEGACY_HELLO_COMMAND,
8-
type MongoClient,
9-
ScramSHA256
10-
} from '../../mongodb_runtime-testing';
5+
import { Connection, LEGACY_HELLO_COMMAND, type MongoClient, ScramSHA256 } from '../../mongodb';
116
import { type TestConfiguration } from '../../tools/runner/config';
127

138
function makeConnectionString(config, username, password) {

test/integration/auth/mongodb_aws.prose.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import { expect } from 'chai';
22
import * as process from 'process';
33

4-
import {
5-
AWSSDKCredentialProvider,
6-
type MongoClient,
7-
MongoServerError
8-
} from '../../mongodb_runtime-testing';
4+
import { AWSSDKCredentialProvider, type MongoClient, MongoServerError } from '../../mongodb';
95
const isMongoDBAWSAuthEnvironment = (process.env.MONGODB_URI ?? '').includes('MONGODB-AWS');
106

117
describe('MONGODB-AWS Prose Tests', function () {

test/integration/auth/mongodb_aws.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
MongoServerError,
2222
refreshKMSCredentials,
2323
setDifference
24-
} from '../../mongodb_runtime-testing';
24+
} from '../../mongodb';
2525
const isMongoDBAWSAuthEnvironment = (process.env.MONGODB_URI ?? '').includes('MONGODB-AWS');
2626

2727
describe('MONGODB-AWS', function () {

test/integration/auth/mongodb_oidc.prose.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
type OIDCCallbackFunction,
1515
type OIDCCallbackParams,
1616
type OIDCResponse
17-
} from '../../mongodb_runtime-testing';
17+
} from '../../mongodb';
1818
const createCallback = (tokenFile = 'test_user1', expiresInSeconds?: number, extraFields?: any) => {
1919
return async (params: OIDCCallbackParams) => {
2020
const token = await readFile(path.join(process.env.OIDC_TOKEN_DIR, tokenFile), {

0 commit comments

Comments
 (0)