Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f5fca7e
test(NODE-7179): migrate unit/operations/aggregate.test.ts
tadjik1 Oct 16, 2025
380ee7d
test(NODE-7179): migrate integration/auth/*
tadjik1 Oct 16, 2025
500a4bb
test(NODE-7179): migrate integration/causal-consistency/*
tadjik1 Oct 16, 2025
2cce19c
test(NODE-7179): migrate integration/client-side-encryption/*
tadjik1 Oct 16, 2025
9f06e49
test(NODE-7179): migrate integration/client-side-operations-timeout/*
tadjik1 Oct 16, 2025
150d37c
test(NODE-7179): migrate integration/command-logging-and-monitoring/*
tadjik1 Oct 16, 2025
0ff42b7
test(NODE-7179): migrate integration/connections-survive-step-down/*
tadjik1 Oct 16, 2025
c05b946
test(NODE-7179): migrate integration/index_management.test.ts
tadjik1 Oct 16, 2025
9c36132
test(NODE-7179): migrate integration/index-management/*
tadjik1 Oct 16, 2025
bac259d
test(NODE-7179): migrate integration/initial-dns-seedlist-discovery/*
tadjik1 Oct 16, 2025
97884bd
test(NODE-7179): migrate integration/max-staleness/*
tadjik1 Oct 16, 2025
cbfd710
test(NODE-7179): migrate integration/mongodb-handshake/*
tadjik1 Oct 16, 2025
6f6101e
test(NODE-7179): migrate integration/retryable-writes/*
tadjik1 Oct 16, 2025
48d7394
test(NODE-7179): migrate integration/run-command/*
tadjik1 Oct 16, 2025
5426397
test(NODE-7179): migrate integration/server-discovery-and-monitoring/*
tadjik1 Oct 16, 2025
4d4a2ca
test(NODE-7179): migrate test/csfle-kms-providers.ts
tadjik1 Oct 16, 2025
86cc350
test(NODE-7179): migrate test/manual/*
tadjik1 Oct 16, 2025
60b60cb
test(NODE-7179): migrate test/spec/*
tadjik1 Oct 16, 2025
bea7dd1
test(NODE-7179): migrate test/types/*
tadjik1 Oct 16, 2025
c20700b
test(NODE-7179): migrate test/tools/*
tadjik1 Oct 16, 2025
3ed3ae5
test(NODE-7179): migrate test/integration/collection-management/*
tadjik1 Oct 16, 2025
863206b
test(NODE-7179): migrate test/integration/crud/*
tadjik1 Oct 16, 2025
ac125a4
test(NODE-7179): migrate test/integration/enumerate_databases.test.ts
tadjik1 Oct 16, 2025
bee9e2f
test(NODE-7179): migrate test/integration/enumerate_databases.prose.t…
tadjik1 Oct 16, 2025
3df73dd
test(NODE-7179): migrate test/integration/node-specific/*
tadjik1 Oct 16, 2025
c99c7e8
test(NODE-7179): migrate test/integration/auth/mongodb_aws.prose.test.ts
tadjik1 Oct 16, 2025
e71265d
test(NODE-7179): migrate test/integration/server-selection/*
tadjik1 Oct 16, 2025
191a2d2
test(NODE-7179): migrate test/integration/retryable-reads/*
tadjik1 Oct 16, 2025
f1b4d8c
test(NODE-7179): migrate test/integration/connection-monitoring-and-p…
tadjik1 Oct 16, 2025
ef2932c
test(NODE-7179): migrate test/integration/client-side-operations-time…
tadjik1 Oct 16, 2025
48bbfc8
test(NODE-7179): fix invalid imports
tadjik1 Oct 16, 2025
718b90c
test(NODE-7179): fix duplicated import
tadjik1 Oct 17, 2025
946ffb1
test(NODE-7179): cleanup imports
tadjik1 Oct 17, 2025
55b6a5c
test(NODE-7179): import client from src
tadjik1 Oct 17, 2025
07b494c
test(NODE-7179): revert changes in examples/ folder
tadjik1 Oct 17, 2025
0fd357e
temporary skip tests in wip
tadjik1 Oct 17, 2025
1e9655d
test(NODE-7179): import classes instead of types
tadjik1 Oct 17, 2025
496acec
skip operations
tadjik1 Oct 17, 2025
4c56e60
remove TODO(NODE-6599) comments
tadjik1 Oct 20, 2025
892a2ab
remove .js files which were migrated to .ts
tadjik1 Oct 24, 2025
f251f50
unskip operations test
tadjik1 Oct 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/csfle-kms-providers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type KMSProviders } from './mongodb';
import { type KMSProviders } from './../src';

const csfleKMSProviders = {
aws: {
Expand Down
5 changes: 4 additions & 1 deletion test/integration/auth/auth.prose.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { expect } from 'chai';
import * as sinon from 'sinon';

import { Connection, LEGACY_HELLO_COMMAND, type MongoClient, ScramSHA256 } from '../../mongodb';
import { type MongoClient } from '../../../src';
import { ScramSHA256 } from '../../../src/cmap/auth/scram';
import { Connection } from '../../../src/cmap/connection';
import { LEGACY_HELLO_COMMAND } from '../../../src/constants';
import { type TestConfiguration } from '../../tools/runner/config';

function makeConnectionString(config, username, password) {
Expand Down
3 changes: 2 additions & 1 deletion test/integration/auth/mongodb_aws.prose.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import * as process from 'node:process';

import { expect } from 'chai';

import { AWSSDKCredentialProvider, type MongoClient, MongoServerError } from '../../mongodb';
import { type MongoClient, MongoServerError } from '../../../src';
import { AWSSDKCredentialProvider } from '../../../src/cmap/auth/aws_temporary_credentials';

const isMongoDBAWSAuthEnvironment = (process.env.MONGODB_URI ?? '').includes('MONGODB-AWS');

Expand Down
14 changes: 7 additions & 7 deletions test/integration/auth/mongodb_aws.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ import * as http from 'http';
import { performance } from 'perf_hooks';
import * as sinon from 'sinon';

import { refreshKMSCredentials } from '../../../src/client-side-encryption/providers';
import {
AWSSDKCredentialProvider,
type CommandOptions,
Connection,
type Document,
MongoAWSError,
type MongoClient,
MongoDBAWS,
type MongoDBNamespace,
type MongoDBResponseConstructor,
MongoMissingCredentialsError,
MongoMissingDependencyError,
MongoServerError,
setDifference
} from '../../mongodb';
MongoServerError
} from '../../../src';
import { refreshKMSCredentials } from '../../../src/client-side-encryption/providers';
import { AWSSDKCredentialProvider } from '../../../src/cmap/auth/aws_temporary_credentials';
import { MongoDBAWS } from '../../../src/cmap/auth/mongodb_aws';
import { Connection } from '../../../src/cmap/connection';
import { setDifference } from '../../../src/utils';

const isMongoDBAWSAuthEnvironment = (process.env.MONGODB_URI ?? '').includes('MONGODB-AWS');

Expand Down
4 changes: 2 additions & 2 deletions test/integration/auth/mongodb_oidc.prose.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
type ClientSession,
type Collection,
MongoClient,
type MongoDBOIDC,
type OIDCCallbackParams,
type OIDCResponse
} from '../../mongodb';
} from '../../../src';
import { type MongoDBOIDC } from '../../../src/cmap/auth/mongodb_oidc';

const createCallback = (tokenFile = 'test_user1', expiresInSeconds?: number, extraFields?: any) => {
return async (params: OIDCCallbackParams) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from 'chai';

import { type Collection, MongoClient, type MongoClientOptions } from '../../mongodb';
import { type Collection, MongoClient, type MongoClientOptions } from '../../../src';

const DEFAULT_URI = 'mongodb://127.0.0.1:27017';

Expand Down
2 changes: 1 addition & 1 deletion test/integration/auth/mongodb_oidc_gcp.prose.06.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from 'chai';

import { type Collection, MongoClient, type MongoClientOptions } from '../../mongodb';
import { type Collection, MongoClient, type MongoClientOptions } from '../../../src';

const DEFAULT_URI = 'mongodb://127.0.0.1:27017';

Expand Down
2 changes: 1 addition & 1 deletion test/integration/auth/mongodb_oidc_k8s.prose.07.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from 'chai';

import { type Collection, MongoClient } from '../../mongodb';
import { type Collection, MongoClient } from '../../../src';

const DEFAULT_URI = 'mongodb://127.0.0.1:27017';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const { LEGACY_HELLO_COMMAND } = require('../../mongodb');
const { LEGACY_HELLO_COMMAND } = require('../../../src/constants');

const { setupDatabase } = require('../shared');
const { expect } = require('chai');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import {
type CommandStartedEvent,
type CommandSucceededEvent,
type Document,
LEGACY_HELLO_COMMAND,
Long,
type MongoClient,
MongoNetworkError,
ObjectId,
Timestamp
} from '../../mongodb';
} from '../../../src';
import { LEGACY_HELLO_COMMAND } from '../../../src/constants';
import * as mock from '../../tools/mongodb-mock/index';
import { setupDatabase } from '../shared';

Expand All @@ -31,7 +31,7 @@ function triggerResumableError(changeStream: ChangeStream, delay: number, onClos
function triggerResumableError(
changeStream: ChangeStream,
delay: number | (() => void),
onClose?: () => void
onClose?: (err?: Error) => void
) {
if (typeof delay === 'function') {
onClose = delay;
Expand All @@ -53,7 +53,7 @@ function triggerResumableError(
}

const nextStub = sinon.stub(changeStream.cursor, 'next').callsFake(async function () {
callback(new MongoNetworkError('error triggered from test'));
onClose(new MongoNetworkError('error triggered from test'));
Comment thread
durran marked this conversation as resolved.
nextStub.restore();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { expect } from 'chai';
import * as fs from 'fs';
import * as path from 'path';

import { type MongoClient, WriteConcern } from '../../../src';
import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption';
import { getCSFLEKMSProviders } from '../../csfle-kms-providers';
import { type MongoClient, WriteConcern } from '../../mongodb';
import { getEncryptExtraOptions } from '../../tools/utils';

describe('Client Side Encryption Prose Corpus Test', function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { expect } from 'chai';
import { satisfies } from 'semver';

import { ClientEncryption, type MongoClient } from '../../../src';
import { getCSFLEKMSProviders } from '../../csfle-kms-providers';
import { ClientEncryption, type MongoClient } from '../../mongodb';

const metadata: MongoDBMetadataUI = {
requires: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { expect } from 'chai';
import { readFileSync } from 'fs';
import * as path from 'path';

import { type CommandStartedEvent, type MongoClient, type MongoClientOptions } from '../../../src';
import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption';
import { type CommandStartedEvent, type MongoClient, type MongoClientOptions } from '../../mongodb';
import { type TestConfiguration } from '../../tools/runner/config';
import { getEncryptExtraOptions } from '../../tools/utils';
import { dropCollection } from '../shared';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { expect } from 'chai';

import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption';
import {
Binary,
BSON,
type CommandFailedEvent,
type CommandSucceededEvent,
type MongoClient,
MongoNetworkError
} from '../../mongodb';
} from '../../../src';
import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption';
import { getEncryptExtraOptions } from '../../tools/utils';

const metadata: MongoDBMetadataUI = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { expect } from 'chai';
import { env } from 'process';

import { Binary } from '../../../src';
import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption';
import { Binary } from '../../mongodb';

const dataKeyOptions = {
masterKey: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { expect } from 'chai';

import { type Document } from '../../../src';
import { MongoCryptAzureKMSRequestError } from '../../../src/client-side-encryption/errors';
import {
type AzureKMSRequestOptions,
fetchAzureKMSToken
} from '../../../src/client-side-encryption/providers/azure';
import { type Document } from '../../mongodb';

const BASE_URL = new URL(`http://127.0.0.1:8080/metadata/identity/oauth2/token`);
class KMSRequestOptions implements AzureKMSRequestOptions {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { expect } from 'chai';
import { env } from 'process';

import { Binary } from '../../../src';
import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption';
import { MongoCryptAzureKMSRequestError } from '../../../src/client-side-encryption/errors';
import { Binary } from '../../mongodb';

const dataKeyOptions = {
masterKey: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { expect } from 'chai';
import { once } from 'events';
import { createServer, type Server } from 'net';

import { type MongoClient } from '../../../src';
import { getCSFLEKMSProviders } from '../../csfle-kms-providers';
import { type MongoClient } from '../../mongodb';
import { getEncryptExtraOptions } from '../../tools/utils';

describe('20. Bypass creating mongocryptd client when shared library is loaded', function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { expect } from 'chai';

import { Collection, type Db, MongoServerError } from '../../../src';
import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption';
import { MongoCryptCreateEncryptedCollectionError } from '../../../src/client-side-encryption/errors';
import {
getCSFLEKMSProviders,
kmsCredentialsPresent,
missingKeys
} from '../../csfle-kms-providers';
import { Collection, type Db, MongoServerError } from '../../mongodb';

const metadata: MongoDBMetadataUI = {
requires: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { expect } from 'chai';

import { type Binary, Int32, Long } from '../../../src';
import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption';
import { getCSFLEKMSProviders } from '../../csfle-kms-providers';
import { type Binary, Int32, Long } from '../../mongodb';

const metaData: MongoDBMetadataUI = {
requires: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import * as path from 'node:path';

import { expect } from 'chai';

import { BSON, type Document, type MongoClient } from '../../../src';
import { getCSFLEKMSProviders } from '../../csfle-kms-providers';
import { BSON, type Document, type MongoClient } from '../../mongodb';
import { type TestConfiguration } from '../../tools/runner/config';
import { getEncryptExtraOptions } from '../../tools/utils';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { expect } from 'chai';

import { Binary, MongoClient } from '../../../src';
import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption';
import { AWSSDKCredentialProvider, Binary, MongoClient } from '../../mongodb';
import { AWSSDKCredentialProvider } from '../../../src/cmap/auth/aws_temporary_credentials';
import { getEncryptExtraOptions } from '../../tools/utils';

const metadata: MongoDBMetadataUI = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { join } from 'node:path';
import { type Binary, type Document, EJSON } from 'bson';
import { expect } from 'chai';

import { ClientEncryption, type MongoClient } from '../../../src';
import { MongoDBCollectionNamespace } from '../../../src/utils';
import { getCSFLEKMSProviders } from '../../csfle-kms-providers';
import { ClientEncryption, type MongoClient, MongoDBCollectionNamespace } from '../../mongodb';

const metadata: MongoDBMetadataUI = {
requires: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ import * as fs from 'fs/promises';
import * as path from 'path';
import { satisfies } from 'semver';

import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption';
import { getCSFLEKMSProviders } from '../../csfle-kms-providers';
import {
LEGACY_HELLO_COMMAND,
MongoClient,
MongoCryptError,
MongoRuntimeError,
MongoServerError,
MongoServerSelectionError
} from '../../mongodb';
} from '../../../src';
import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption';
import { LEGACY_HELLO_COMMAND } from '../../../src/constants';
import { getCSFLEKMSProviders } from '../../csfle-kms-providers';
import { AlpineTestConfiguration } from '../../tools/runner/config';
import { getEncryptExtraOptions } from '../../tools/utils';
import { APMEventCollector, dropCollection } from '../shared';
Expand Down
17 changes: 8 additions & 9 deletions test/integration/client-side-encryption/driver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,21 @@ import * as sinon from 'sinon';
import { setTimeout } from 'timers/promises';
import * as tls from 'tls';

import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption';
import { getCSFLEKMSProviders } from '../../csfle-kms-providers';
import {
BSON,
type Collection,
type CommandStartedEvent,
Connection,
CSOTTimeoutContext,
type MongoClient,
MongoCryptCreateDataKeyError,
MongoCryptCreateEncryptedCollectionError,
MongoOperationTimeoutError,
resolveTimeoutOptions,
StateMachine,
TimeoutContext
} from '../../mongodb';
MongoOperationTimeoutError
} from '../../../src';
import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption';
import { StateMachine } from '../../../src/client-side-encryption/state_machine';
import { Connection } from '../../../src/cmap/connection';
import { CSOTTimeoutContext, TimeoutContext } from '../../../src/timeout';
import { resolveTimeoutOptions } from '../../../src/utils';
import { getCSFLEKMSProviders } from '../../csfle-kms-providers';
import {
clearFailPoint,
configureFailPoint,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,19 @@ import * as semver from 'semver';
import * as sinon from 'sinon';
import { pipeline } from 'stream/promises';

import { type CommandStartedEvent } from '../../../mongodb';
import {
Binary,
ClientEncryption,
type CommandStartedEvent,
type CommandSucceededEvent,
GridFSBucket,
MongoBulkWriteError,
MongoClient,
MongoOperationTimeoutError,
MongoServerSelectionError,
now,
ObjectId,
squashError
} from '../../mongodb';
ObjectId
} from '../../../src';
import { now, squashError } from '../../../src/utils';
import {
clearFailPoint,
configureFailPoint,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,12 @@ import { setTimeout } from 'timers';
import { TLSSocket } from 'tls';
import { promisify } from 'util';

import { type MongoClient, MongoOperationTimeoutError, ObjectId } from '../../../src';
import { StateMachine } from '../../../src/client-side-encryption/state_machine';
import {
Connection,
ConnectionPool,
CSOTTimeoutContext,
type MongoClient,
MongoOperationTimeoutError,
ObjectId,
Timeout,
TimeoutContext,
Topology
} from '../../mongodb';
import { Connection } from '../../../src/cmap/connection';
import { ConnectionPool } from '../../../src/cmap/connection_pool';
import { Topology } from '../../../src/sdam/topology';
import { CSOTTimeoutContext, Timeout, TimeoutContext } from '../../../src/timeout';
import { measureDuration, sleep } from '../../tools/utils';
import { createTimerSandbox } from '../../unit/timer_sandbox';

Expand Down
Loading