From 67e9d6390cdf534bc47a4b66605e6db0cd1f1111 Mon Sep 17 00:00:00 2001 From: Pavel Safronov Date: Tue, 9 Dec 2025 11:12:55 -0800 Subject: [PATCH] fix(NODE-7306): Replace global process with import node:process --- .eslintrc.json | 6 +++++- src/client-side-encryption/state_machine.ts | 2 ++ src/cmap/auth/aws_temporary_credentials.ts | 2 ++ src/cmap/auth/gssapi.ts | 2 ++ .../auth/mongodb_oidc/k8s_machine_workflow.ts | 2 ++ .../mongodb_oidc/token_machine_workflow.ts | 2 ++ src/cmap/connection_pool.ts | 2 ++ src/connection_string.ts | 2 ++ src/gridfs/upload.ts | 2 ++ src/mongo_logger.ts | 2 ++ src/sdam/monitor.ts | 2 ++ src/sdam/server.ts | 2 ++ src/sdam/topology.ts | 2 ++ src/utils.ts | 2 ++ test/atlas/drivers_atlas_testing.test.ts | 2 ++ test/benchmarks/driver_bench/src/main.mts | 5 +++-- test/benchmarks/unitBench/list.bench.js | 1 + test/csfle-kms-providers.ts | 2 ++ .../explicit-resource-management/main.test.ts | 2 ++ test/integration/auth/auth.prose.test.ts | 2 ++ .../auth/mongodb_oidc.prose.test.ts | 1 + .../auth/mongodb_oidc_azure.prose.05.test.ts | 2 ++ .../auth/mongodb_oidc_gcp.prose.06.test.ts | 2 ++ .../auth/mongodb_oidc_k8s.prose.07.test.ts | 2 ++ ...nt_side_encryption.prose.06.corpus.test.ts | 2 ++ ...t_side_encryption.prose.10.kms_tls.test.ts | 2 ++ ..._side_encryption.prose.12.deadlock.test.ts | 2 ++ ...26.custom_aws_credential_providers.test.ts | 2 ++ .../client_side_encryption.prose.test.ts | 2 ++ .../client-side-encryption/driver.test.ts | 2 ++ .../connection.test.ts | 1 + test/integration/crud/insert.test.ts | 3 ++- test/integration/crud/unicode.test.ts | 2 ++ .../load_balancers.spec.test.ts | 2 ++ .../mongodb-handshake.prose.test.ts | 2 ++ .../bson-options/utf8_validation.test.ts | 2 ++ .../node-specific/client_close.test.ts | 1 + .../node-specific/compression.test.ts | 2 ++ .../node-specific/crypt_shared_lib.test.ts | 2 ++ .../node-specific/cursor_stream.test.ts | 1 + .../node-specific/examples/aws_handler.js | 1 + .../examples/change_streams.test.js | 3 ++- .../node-specific/examples/handler.js | 1 + .../node-specific/mongo_client.test.ts | 2 ++ .../node-specific/operation_examples.test.ts | 2 ++ .../resource_tracking_script_builder.ts | 1 + .../read-write-concern/write_concern.test.ts | 2 ++ test/integration/uri-options/uri.test.ts | 2 ++ test/lambda/mongodb/app.mjs | 19 ++++++++++--------- test/manual/atlas_connectivity.test.ts | 2 ++ test/manual/kerberos.test.ts | 2 ++ test/manual/ldap.test.ts | 2 ++ test/manual/mocharc.js | 1 + test/manual/mongosh_scopes.test.ts | 2 ++ .../search-index-management.prose.test.ts | 2 ++ test/manual/socks5.test.ts | 2 ++ test/manual/x509_auth.test.ts | 2 ++ test/mocha_lambda.js | 1 + test/mocha_mongodb.js | 1 + test/tools/cmap_spec_runner.ts | 2 ++ test/tools/fixtures/shared_library_test.js | 1 + test/tools/mongodb-mock/index.js | 1 + test/tools/reporter/mongodb_reporter.js | 1 + test/tools/runner/config.ts | 1 + test/tools/runner/ee_checker.ts | 2 ++ .../runner/filters/api_version_filter.ts | 2 ++ test/tools/runner/filters/auth_filter.ts | 2 ++ .../runner/filters/idms_mock_server_filter.ts | 2 ++ .../runner/filters/node_version_filter.ts | 2 ++ test/tools/runner/filters/os_filter.ts | 2 ++ test/tools/runner/hooks/configuration.ts | 2 ++ test/tools/runner/hooks/leak_checker.ts | 3 +++ test/tools/spec-runner/context.js | 1 + test/tools/spec-runner/index.js | 1 + test/tools/spec-runner/utils.js | 1 + .../astrolabe_results_writer.ts | 1 + test/tools/unified-spec-runner/entities.ts | 2 ++ test/tools/unified-spec-runner/operations.ts | 1 + test/tools/unified-spec-runner/runner.ts | 2 ++ .../unified-spec-runner/unified-utils.ts | 2 ++ test/tools/utils.ts | 1 + ...records_for_mongos_discovery.prose.test.ts | 2 ++ .../auto_encrypter.test.ts | 2 ++ .../providers/credentialsProvider.test.ts | 2 ++ .../requirements.helper.ts | 2 ++ .../token_machine_workflow.test.ts | 2 ++ test/unit/cmap/connect.test.ts | 2 ++ test/unit/mongo_client.test.ts | 2 ++ test/unit/mongo_logger.test.ts | 2 ++ test/unit/sdam/monitor.test.ts | 1 + test/unit/sdam/topology.test.ts | 2 ++ 91 files changed, 173 insertions(+), 14 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index a515ec3b88d..fbae2ca2ba5 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -50,6 +50,10 @@ { "name": "setInterval", "message": "Use `import { setInterval } from 'timers';` instead" + }, + { + "name": "process", + "message": "Use `import * as process from 'node:process';` instead" } ], "prettier/prettier": "error", @@ -318,4 +322,4 @@ } } ] -} \ No newline at end of file +} diff --git a/src/client-side-encryption/state_machine.ts b/src/client-side-encryption/state_machine.ts index 83d66c9008c..5f863552656 100644 --- a/src/client-side-encryption/state_machine.ts +++ b/src/client-side-encryption/state_machine.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import * as fs from 'fs/promises'; import { type MongoCryptContext, type MongoCryptKMSRequest } from 'mongodb-client-encryption'; import * as net from 'net'; diff --git a/src/cmap/auth/aws_temporary_credentials.ts b/src/cmap/auth/aws_temporary_credentials.ts index 8c1c9ff0eba..7c618211bdf 100644 --- a/src/cmap/auth/aws_temporary_credentials.ts +++ b/src/cmap/auth/aws_temporary_credentials.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { type AWSCredentials, getAwsCredentialProvider } from '../../deps'; import { MongoAWSError } from '../../error'; diff --git a/src/cmap/auth/gssapi.ts b/src/cmap/auth/gssapi.ts index 430b97d213f..4a55c0d8536 100644 --- a/src/cmap/auth/gssapi.ts +++ b/src/cmap/auth/gssapi.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import * as dns from 'dns'; import { getKerberos, type Kerberos, type KerberosClient } from '../../deps'; diff --git a/src/cmap/auth/mongodb_oidc/k8s_machine_workflow.ts b/src/cmap/auth/mongodb_oidc/k8s_machine_workflow.ts index 1df15926b10..eb9f0bbca57 100644 --- a/src/cmap/auth/mongodb_oidc/k8s_machine_workflow.ts +++ b/src/cmap/auth/mongodb_oidc/k8s_machine_workflow.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { readFile } from 'fs/promises'; import type { OIDCCallbackFunction, OIDCResponse } from '../mongodb_oidc'; diff --git a/src/cmap/auth/mongodb_oidc/token_machine_workflow.ts b/src/cmap/auth/mongodb_oidc/token_machine_workflow.ts index 340be227453..b3c21b80d26 100644 --- a/src/cmap/auth/mongodb_oidc/token_machine_workflow.ts +++ b/src/cmap/auth/mongodb_oidc/token_machine_workflow.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import * as fs from 'fs'; import { MongoAWSError } from '../../../error'; diff --git a/src/cmap/connection_pool.ts b/src/cmap/connection_pool.ts index 3f16c719300..5d7488d249f 100644 --- a/src/cmap/connection_pool.ts +++ b/src/cmap/connection_pool.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { clearTimeout, setTimeout } from 'timers'; import type { ObjectId } from '../bson'; diff --git a/src/connection_string.ts b/src/connection_string.ts index ad6beb84f81..bfcf587bd9e 100644 --- a/src/connection_string.ts +++ b/src/connection_string.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import * as dns from 'dns'; import ConnectionString from 'mongodb-connection-string-url'; import { URLSearchParams } from 'url'; diff --git a/src/gridfs/upload.ts b/src/gridfs/upload.ts index bd1449da4a1..474fe4ec5e0 100644 --- a/src/gridfs/upload.ts +++ b/src/gridfs/upload.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { Writable } from 'stream'; import { type Document, ObjectId } from '../bson'; diff --git a/src/mongo_logger.ts b/src/mongo_logger.ts index fd869d63394..e519aa02b43 100644 --- a/src/mongo_logger.ts +++ b/src/mongo_logger.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { inspect } from 'util'; import { diff --git a/src/sdam/monitor.ts b/src/sdam/monitor.ts index f0e574ff7e2..e637aa23324 100644 --- a/src/sdam/monitor.ts +++ b/src/sdam/monitor.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { clearTimeout, setTimeout } from 'timers'; import { type Document, Long } from '../bson'; diff --git a/src/sdam/server.ts b/src/sdam/server.ts index 028dad80ffa..c9f775dba63 100644 --- a/src/sdam/server.ts +++ b/src/sdam/server.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import type { Document } from '../bson'; import { type AutoEncrypter } from '../client-side-encryption/auto_encrypter'; import { type CommandOptions, Connection } from '../cmap/connection'; diff --git a/src/sdam/topology.ts b/src/sdam/topology.ts index eba356b020e..246b597dde0 100644 --- a/src/sdam/topology.ts +++ b/src/sdam/topology.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import type { BSONSerializeOptions, Document } from '../bson'; import type { MongoCredentials } from '../cmap/auth/mongo_credentials'; import type { ConnectionEvents } from '../cmap/connection'; diff --git a/src/utils.ts b/src/utils.ts index c0f0864dbf8..dc7d2d2fb5a 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import * as crypto from 'crypto'; import type { SrvRecord } from 'dns'; import { type EventEmitter } from 'events'; diff --git a/test/atlas/drivers_atlas_testing.test.ts b/test/atlas/drivers_atlas_testing.test.ts index 6e138f04f99..9a4bc2c303c 100644 --- a/test/atlas/drivers_atlas_testing.test.ts +++ b/test/atlas/drivers_atlas_testing.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { runUnifiedSuite } from '../tools/unified-spec-runner/runner'; describe('Node Driver Atlas Testing', function () { diff --git a/test/benchmarks/driver_bench/src/main.mts b/test/benchmarks/driver_bench/src/main.mts index 251ae42b4b3..00fb25d7262 100644 --- a/test/benchmarks/driver_bench/src/main.mts +++ b/test/benchmarks/driver_bench/src/main.mts @@ -5,6 +5,7 @@ import events from 'node:events'; import fs from 'node:fs/promises'; import os from 'node:os'; import path from 'node:path'; +import process from 'node:process'; import util from 'node:util'; import { @@ -113,8 +114,8 @@ for (const [suite, benchmarks] of Object.entries(tests)) { const metricInfoFilterByName = (testName: string) => - ({ info: { test_name } }: MetricInfo) => - test_name === testName; + ({ info: { test_name } }: MetricInfo) => + test_name === testName; const isMBsMetric = ({ name }: Metric) => name === 'megabytes_per_second'; diff --git a/test/benchmarks/unitBench/list.bench.js b/test/benchmarks/unitBench/list.bench.js index 7e1a8fba4c5..cd00b2ab478 100644 --- a/test/benchmarks/unitBench/list.bench.js +++ b/test/benchmarks/unitBench/list.bench.js @@ -1,6 +1,7 @@ const chalk = require('chalk'); const { List } = require('../../../src/utils'); const { createHistogram } = require('perf_hooks'); +import * as process from 'node:process'; const iterations = 100; const defaultItemsSize = 100000; diff --git a/test/csfle-kms-providers.ts b/test/csfle-kms-providers.ts index 9825c6f2d6a..7d004ccdc9b 100644 --- a/test/csfle-kms-providers.ts +++ b/test/csfle-kms-providers.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { type KMSProviders } from './../src'; const csfleKMSProviders = { diff --git a/test/explicit-resource-management/main.test.ts b/test/explicit-resource-management/main.test.ts index 746aac078f5..f30092efa87 100644 --- a/test/explicit-resource-management/main.test.ts +++ b/test/explicit-resource-management/main.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import { describe, it } from 'mocha'; import { AbstractCursor, ChangeStream, ClientSession, GridFSBucket, MongoClient } from 'mongodb'; diff --git a/test/integration/auth/auth.prose.test.ts b/test/integration/auth/auth.prose.test.ts index 50e1cb7172b..cf1292c6ccb 100644 --- a/test/integration/auth/auth.prose.test.ts +++ b/test/integration/auth/auth.prose.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import * as sinon from 'sinon'; diff --git a/test/integration/auth/mongodb_oidc.prose.test.ts b/test/integration/auth/mongodb_oidc.prose.test.ts index ed0bc077e76..aafcc69752c 100644 --- a/test/integration/auth/mongodb_oidc.prose.test.ts +++ b/test/integration/auth/mongodb_oidc.prose.test.ts @@ -1,5 +1,6 @@ import { readFile } from 'node:fs/promises'; import * as path from 'node:path'; +import * as process from 'node:process'; import { expect } from 'chai'; import * as sinon from 'sinon'; diff --git a/test/integration/auth/mongodb_oidc_azure.prose.05.test.ts b/test/integration/auth/mongodb_oidc_azure.prose.05.test.ts index 0eca37979b4..ad5aaf33d60 100644 --- a/test/integration/auth/mongodb_oidc_azure.prose.05.test.ts +++ b/test/integration/auth/mongodb_oidc_azure.prose.05.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import { type Collection, MongoClient, type MongoClientOptions } from '../../../src'; diff --git a/test/integration/auth/mongodb_oidc_gcp.prose.06.test.ts b/test/integration/auth/mongodb_oidc_gcp.prose.06.test.ts index 2385222061b..4ca1bdf231f 100644 --- a/test/integration/auth/mongodb_oidc_gcp.prose.06.test.ts +++ b/test/integration/auth/mongodb_oidc_gcp.prose.06.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import { type Collection, MongoClient, type MongoClientOptions } from '../../../src'; diff --git a/test/integration/auth/mongodb_oidc_k8s.prose.07.test.ts b/test/integration/auth/mongodb_oidc_k8s.prose.07.test.ts index a6de8ad7ea4..c132c571a06 100644 --- a/test/integration/auth/mongodb_oidc_k8s.prose.07.test.ts +++ b/test/integration/auth/mongodb_oidc_k8s.prose.07.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import { type Collection, MongoClient } from '../../../src'; diff --git a/test/integration/client-side-encryption/client_side_encryption.prose.06.corpus.test.ts b/test/integration/client-side-encryption/client_side_encryption.prose.06.corpus.test.ts index 0d9657f6162..7c0060cbfae 100644 --- a/test/integration/client-side-encryption/client_side_encryption.prose.06.corpus.test.ts +++ b/test/integration/client-side-encryption/client_side_encryption.prose.06.corpus.test.ts @@ -1,5 +1,7 @@ // The corpus test exhaustively enumerates all ways to encrypt all BSON value types. Note, the test data includes BSON binary subtype 4 (or standard UUID), which MUST be decoded and encoded as subtype 4. Run the test as follows. +import * as process from 'node:process'; + import { EJSON } from 'bson'; import { expect } from 'chai'; import * as fs from 'fs'; diff --git a/test/integration/client-side-encryption/client_side_encryption.prose.10.kms_tls.test.ts b/test/integration/client-side-encryption/client_side_encryption.prose.10.kms_tls.test.ts index b2a678a2dc7..01d52cb26b6 100644 --- a/test/integration/client-side-encryption/client_side_encryption.prose.10.kms_tls.test.ts +++ b/test/integration/client-side-encryption/client_side_encryption.prose.10.kms_tls.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import { satisfies } from 'semver'; diff --git a/test/integration/client-side-encryption/client_side_encryption.prose.12.deadlock.test.ts b/test/integration/client-side-encryption/client_side_encryption.prose.12.deadlock.test.ts index ed3d9fdadd8..835477af5e7 100644 --- a/test/integration/client-side-encryption/client_side_encryption.prose.12.deadlock.test.ts +++ b/test/integration/client-side-encryption/client_side_encryption.prose.12.deadlock.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import * as BSON from 'bson'; import { expect } from 'chai'; import { readFileSync } from 'fs'; diff --git a/test/integration/client-side-encryption/client_side_encryption.prose.26.custom_aws_credential_providers.test.ts b/test/integration/client-side-encryption/client_side_encryption.prose.26.custom_aws_credential_providers.test.ts index a7351c96fb9..bebc29cf1ea 100644 --- a/test/integration/client-side-encryption/client_side_encryption.prose.26.custom_aws_credential_providers.test.ts +++ b/test/integration/client-side-encryption/client_side_encryption.prose.26.custom_aws_credential_providers.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import { Binary, MongoClient } from '../../../src'; diff --git a/test/integration/client-side-encryption/client_side_encryption.prose.test.ts b/test/integration/client-side-encryption/client_side_encryption.prose.test.ts index 280016da601..a9ff89e98d9 100644 --- a/test/integration/client-side-encryption/client_side_encryption.prose.test.ts +++ b/test/integration/client-side-encryption/client_side_encryption.prose.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { BSON, EJSON } from 'bson'; import { expect } from 'chai'; import * as fs from 'fs/promises'; diff --git a/test/integration/client-side-encryption/driver.test.ts b/test/integration/client-side-encryption/driver.test.ts index dfae670e182..09d3e976d16 100644 --- a/test/integration/client-side-encryption/driver.test.ts +++ b/test/integration/client-side-encryption/driver.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { UUID } from 'bson'; import { expect } from 'chai'; import * as crypto from 'crypto'; diff --git a/test/integration/connection-monitoring-and-pooling/connection.test.ts b/test/integration/connection-monitoring-and-pooling/connection.test.ts index 80be489a26f..bae5b5e20eb 100644 --- a/test/integration/connection-monitoring-and-pooling/connection.test.ts +++ b/test/integration/connection-monitoring-and-pooling/connection.test.ts @@ -1,4 +1,5 @@ import { type EventEmitter, once } from 'node:events'; +import * as process from 'node:process'; import { setTimeout } from 'node:timers'; import { expect } from 'chai'; diff --git a/test/integration/crud/insert.test.ts b/test/integration/crud/insert.test.ts index 30b6f0feecd..0c1c3effe8c 100644 --- a/test/integration/crud/insert.test.ts +++ b/test/integration/crud/insert.test.ts @@ -1,3 +1,4 @@ +import * as process from 'node:process'; import * as Script from 'node:vm'; import { expect } from 'chai'; @@ -745,7 +746,7 @@ describe('crud - insert', function () { try { db.collection(k.toString()); test.fail(false); - } catch (ignore) {} // eslint-disable-line + } catch (ignore) { } // eslint-disable-line }); it('should correctly honor `promoteLong:false` native BSON', async function () { diff --git a/test/integration/crud/unicode.test.ts b/test/integration/crud/unicode.test.ts index eec67a8c520..083cf554b79 100644 --- a/test/integration/crud/unicode.test.ts +++ b/test/integration/crud/unicode.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import { satisfies } from 'semver'; diff --git a/test/integration/load-balancers/load_balancers.spec.test.ts b/test/integration/load-balancers/load_balancers.spec.test.ts index 87001d9d455..488f7136855 100644 --- a/test/integration/load-balancers/load_balancers.spec.test.ts +++ b/test/integration/load-balancers/load_balancers.spec.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import * as path from 'path'; import { loadSpecTests } from '../../spec/index'; diff --git a/test/integration/mongodb-handshake/mongodb-handshake.prose.test.ts b/test/integration/mongodb-handshake/mongodb-handshake.prose.test.ts index a8ac32b99cf..f0972cbf553 100644 --- a/test/integration/mongodb-handshake/mongodb-handshake.prose.test.ts +++ b/test/integration/mongodb-handshake/mongodb-handshake.prose.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import * as sinon from 'sinon'; diff --git a/test/integration/node-specific/bson-options/utf8_validation.test.ts b/test/integration/node-specific/bson-options/utf8_validation.test.ts index 84a230478a8..61b0b011304 100644 --- a/test/integration/node-specific/bson-options/utf8_validation.test.ts +++ b/test/integration/node-specific/bson-options/utf8_validation.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import * as net from 'net'; import * as sinon from 'sinon'; diff --git a/test/integration/node-specific/client_close.test.ts b/test/integration/node-specific/client_close.test.ts index ad5bd9cebcb..7dc1abace40 100644 --- a/test/integration/node-specific/client_close.test.ts +++ b/test/integration/node-specific/client_close.test.ts @@ -1,4 +1,5 @@ import * as events from 'node:events'; +import * as process from 'node:process'; import { expect } from 'chai'; diff --git a/test/integration/node-specific/compression.test.ts b/test/integration/node-specific/compression.test.ts index 1e3bada8155..1c6ce293bf9 100644 --- a/test/integration/node-specific/compression.test.ts +++ b/test/integration/node-specific/compression.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; describe('compression configuration tests', function () { diff --git a/test/integration/node-specific/crypt_shared_lib.test.ts b/test/integration/node-specific/crypt_shared_lib.test.ts index b7954ae5963..ab334686412 100644 --- a/test/integration/node-specific/crypt_shared_lib.test.ts +++ b/test/integration/node-specific/crypt_shared_lib.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import { spawnSync } from 'child_process'; import { dirname } from 'path'; diff --git a/test/integration/node-specific/cursor_stream.test.ts b/test/integration/node-specific/cursor_stream.test.ts index 53c2f56dba3..f86778fc86a 100644 --- a/test/integration/node-specific/cursor_stream.test.ts +++ b/test/integration/node-specific/cursor_stream.test.ts @@ -1,5 +1,6 @@ import { strictEqual } from 'node:assert'; import { on, once } from 'node:events'; +import * as process from 'node:process'; import { expect } from 'chai'; diff --git a/test/integration/node-specific/examples/aws_handler.js b/test/integration/node-specific/examples/aws_handler.js index 5ed87eeb898..61493189dd1 100644 --- a/test/integration/node-specific/examples/aws_handler.js +++ b/test/integration/node-specific/examples/aws_handler.js @@ -1,5 +1,6 @@ // begin lambda connection const { MongoClient } = require('mongodb'); +const process = require('node:process'); // Get the URI for the cluster and use AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY // from the environment, then set the appropriate auth options. Note that MongoClient diff --git a/test/integration/node-specific/examples/change_streams.test.js b/test/integration/node-specific/examples/change_streams.test.js index 90737e2ddfc..d30982a8633 100644 --- a/test/integration/node-specific/examples/change_streams.test.js +++ b/test/integration/node-specific/examples/change_streams.test.js @@ -1,4 +1,5 @@ -/* eslint no-unused-vars: 0 */ +/* eslint no-unused-vars: 0 no-restricted-globals: 0 */ + 'use strict'; const { setTimeout } = require('timers'); diff --git a/test/integration/node-specific/examples/handler.js b/test/integration/node-specific/examples/handler.js index a2f791f1fe6..656c4c4935d 100644 --- a/test/integration/node-specific/examples/handler.js +++ b/test/integration/node-specific/examples/handler.js @@ -1,5 +1,6 @@ // begin lambda connection const { MongoClient } = require('mongodb'); +const process = require('node:process'); // MongoClient now auto-connects so no need to store the connect() // promise anywhere and reference it. diff --git a/test/integration/node-specific/mongo_client.test.ts b/test/integration/node-specific/mongo_client.test.ts index e1a40917d4c..e6cda368fe6 100644 --- a/test/integration/node-specific/mongo_client.test.ts +++ b/test/integration/node-specific/mongo_client.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import { once } from 'events'; import * as net from 'net'; diff --git a/test/integration/node-specific/operation_examples.test.ts b/test/integration/node-specific/operation_examples.test.ts index d8e07af5462..b4618f9cd2e 100644 --- a/test/integration/node-specific/operation_examples.test.ts +++ b/test/integration/node-specific/operation_examples.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import { Code, type MongoClient, ProfilingLevel, ReturnDocument } from '../../../src'; diff --git a/test/integration/node-specific/resource_tracking_script_builder.ts b/test/integration/node-specific/resource_tracking_script_builder.ts index c0f6a697f5d..d6a57ae08e6 100644 --- a/test/integration/node-specific/resource_tracking_script_builder.ts +++ b/test/integration/node-specific/resource_tracking_script_builder.ts @@ -3,6 +3,7 @@ import { on, once } from 'node:events'; import { openSync } from 'node:fs'; import { readFile, unlink, writeFile } from 'node:fs/promises'; import * as path from 'node:path'; +import * as process from 'node:process'; import { inspect } from 'node:util'; import { AssertionError, expect } from 'chai'; diff --git a/test/integration/read-write-concern/write_concern.test.ts b/test/integration/read-write-concern/write_concern.test.ts index 4b37055a988..e5e37305c61 100644 --- a/test/integration/read-write-concern/write_concern.test.ts +++ b/test/integration/read-write-concern/write_concern.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import { on, once } from 'events'; import * as sinon from 'sinon'; diff --git a/test/integration/uri-options/uri.test.ts b/test/integration/uri-options/uri.test.ts index dde75c48f00..71e5b899a5a 100644 --- a/test/integration/uri-options/uri.test.ts +++ b/test/integration/uri-options/uri.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import * as sinon from 'sinon'; diff --git a/test/lambda/mongodb/app.mjs b/test/lambda/mongodb/app.mjs index 9d0cf8bee93..e93a5a05e2a 100644 --- a/test/lambda/mongodb/app.mjs +++ b/test/lambda/mongodb/app.mjs @@ -1,4 +1,5 @@ import * as assert from 'node:assert/strict'; +import * as process from 'node:process'; import { MongoClient } from 'mongodb'; @@ -14,47 +15,47 @@ let totalHeartbeatDuration = 0; let totalCommands = 0; let totalCommandDuration = 0; -mongoClient.on('commandStarted', (event) => { +mongoClient.on('commandStarted', event => { console.log('commandStarted', event); }); -mongoClient.on('commandSucceeded', (event) => { +mongoClient.on('commandSucceeded', event => { totalCommands++; totalCommandDuration += event.duration; console.log('commandSucceeded', event); }); -mongoClient.on('commandFailed', (event) => { +mongoClient.on('commandFailed', event => { totalCommands++; totalCommandDuration += event.duration; console.log('commandFailed', event); }); -mongoClient.on('serverHeartbeatStarted', (event) => { +mongoClient.on('serverHeartbeatStarted', event => { console.log('serverHeartbeatStarted', event); assert.strictEqual(event.awaited, false); }); -mongoClient.on('serverHeartbeatSucceeded', (event) => { +mongoClient.on('serverHeartbeatSucceeded', event => { heartbeatCount++; totalHeartbeatDuration += event.duration; console.log('serverHeartbeatSucceeded', event); assert.strictEqual(event.awaited, false); }); -mongoClient.on('serverHeartbeatFailed', (event) => { +mongoClient.on('serverHeartbeatFailed', event => { heartbeatCount++; totalHeartbeatDuration += event.duration; console.log('serverHeartbeatFailed', event); assert.strictEqual(event.awaited, false); }); -mongoClient.on('connectionCreated', (event) => { +mongoClient.on('connectionCreated', event => { openConnections++; console.log('connectionCreated', event); }); -mongoClient.on('connectionClosed', (event) => { +mongoClient.on('connectionClosed', event => { openConnections--; console.log('connectionClosed', event); }); @@ -88,7 +89,7 @@ function reset() { * @param {Object} event - API Gateway Lambda Proxy Input Format * @returns {Object} object - API Gateway Lambda Proxy Output Format */ -export const lambdaHandler = async (event) => { +export const lambdaHandler = async event => { const db = mongoClient.db('lambdaTest'); const collection = db.collection('test'); const { insertedId } = await collection.insertOne({ n: 1 }); diff --git a/test/manual/atlas_connectivity.test.ts b/test/manual/atlas_connectivity.test.ts index 288da73b268..f13ccb19002 100644 --- a/test/manual/atlas_connectivity.test.ts +++ b/test/manual/atlas_connectivity.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { MongoClient } from '../../src'; import { LEGACY_HELLO_COMMAND } from '../../src/constants'; diff --git a/test/manual/kerberos.test.ts b/test/manual/kerberos.test.ts index 92111b25853..1c79226ddc0 100644 --- a/test/manual/kerberos.test.ts +++ b/test/manual/kerberos.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import * as chai from 'chai'; import { promises as dns } from 'dns'; import * as sinon from 'sinon'; diff --git a/test/manual/ldap.test.ts b/test/manual/ldap.test.ts index c727e0ffe54..87078dab3e7 100644 --- a/test/manual/ldap.test.ts +++ b/test/manual/ldap.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import { MongoClient } from '../../src'; diff --git a/test/manual/mocharc.js b/test/manual/mocharc.js index fcb5e647971..431bbf9a343 100644 --- a/test/manual/mocharc.js +++ b/test/manual/mocharc.js @@ -1,5 +1,6 @@ 'use strict'; +const process = require('node:process'); const [major] = process.versions.node.split('.'); /** @type {import("mocha").MochaOptions} */ diff --git a/test/manual/mongosh_scopes.test.ts b/test/manual/mongosh_scopes.test.ts index 70f9e24f104..1fc450ff1e7 100644 --- a/test/manual/mongosh_scopes.test.ts +++ b/test/manual/mongosh_scopes.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; const expectedMongoshScopes = [ diff --git a/test/manual/search-index-management.prose.test.ts b/test/manual/search-index-management.prose.test.ts index 8cdee809515..1966abb7c02 100644 --- a/test/manual/search-index-management.prose.test.ts +++ b/test/manual/search-index-management.prose.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import { lt } from 'semver'; import { Readable } from 'stream'; diff --git a/test/manual/socks5.test.ts b/test/manual/socks5.test.ts index 16e363152bf..9f1dc52c7c3 100644 --- a/test/manual/socks5.test.ts +++ b/test/manual/socks5.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import ConnectionString from 'mongodb-connection-string-url'; diff --git a/test/manual/x509_auth.test.ts b/test/manual/x509_auth.test.ts index 38e7aca79a9..baf7c3528d2 100644 --- a/test/manual/x509_auth.test.ts +++ b/test/manual/x509_auth.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import { ConnectionString } from 'mongodb-connection-string-url'; diff --git a/test/mocha_lambda.js b/test/mocha_lambda.js index b5d117b179a..962ab8a344b 100644 --- a/test/mocha_lambda.js +++ b/test/mocha_lambda.js @@ -1,5 +1,6 @@ 'use strict'; +const process = require('node:process'); const [major] = process.versions.node.split('.'); /** @type {import("mocha").MochaOptions} */ diff --git a/test/mocha_mongodb.js b/test/mocha_mongodb.js index afb7febd9f5..d048520fea6 100644 --- a/test/mocha_mongodb.js +++ b/test/mocha_mongodb.js @@ -1,5 +1,6 @@ 'use strict'; +const process = require('node:process'); const [major] = process.versions.node.split('.'); /** @type {import("mocha").MochaOptions} */ diff --git a/test/tools/cmap_spec_runner.ts b/test/tools/cmap_spec_runner.ts index 6ded70923bc..e2982e0c868 100644 --- a/test/tools/cmap_spec_runner.ts +++ b/test/tools/cmap_spec_runner.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import { EventEmitter } from 'events'; import { clearTimeout, setTimeout } from 'timers'; diff --git a/test/tools/fixtures/shared_library_test.js b/test/tools/fixtures/shared_library_test.js index e87140a4834..04238369a1d 100644 --- a/test/tools/fixtures/shared_library_test.js +++ b/test/tools/fixtures/shared_library_test.js @@ -2,6 +2,7 @@ const { EJSON } = require('bson'); const { AutoEncrypter } = require('../../../lib/client-side-encryption/auto_encrypter'); const { MongoClient } = require('../../../lib/mongo_client'); +const process = require('node:process'); try { const extraOptions = JSON.parse(process.env.EXTRA_OPTIONS); diff --git a/test/tools/mongodb-mock/index.js b/test/tools/mongodb-mock/index.js index 7a6f6240504..50dcdc8aeb6 100644 --- a/test/tools/mongodb-mock/index.js +++ b/test/tools/mongodb-mock/index.js @@ -1,6 +1,7 @@ const fs = require('fs'); const { MockServer } = require('./src/server.js'); const { LEGACY_HELLO_COMMAND } = require('../../../src/constants'); +const process = require('node:process'); let mockServers = []; diff --git a/test/tools/reporter/mongodb_reporter.js b/test/tools/reporter/mongodb_reporter.js index 7849faf1914..ca1036d6c76 100644 --- a/test/tools/reporter/mongodb_reporter.js +++ b/test/tools/reporter/mongodb_reporter.js @@ -2,6 +2,7 @@ 'use strict'; const mocha = require('mocha'); const chalk = require('chalk'); +const process = require('node:process'); chalk.level = 3; diff --git a/test/tools/runner/config.ts b/test/tools/runner/config.ts index c536ea16906..14af6d2dc3b 100644 --- a/test/tools/runner/config.ts +++ b/test/tools/runner/config.ts @@ -1,3 +1,4 @@ +import * as process from 'node:process'; import * as util from 'node:util'; import * as types from 'node:util/types'; diff --git a/test/tools/runner/ee_checker.ts b/test/tools/runner/ee_checker.ts index 3a92264d356..e96d2873ec9 100644 --- a/test/tools/runner/ee_checker.ts +++ b/test/tools/runner/ee_checker.ts @@ -1,5 +1,7 @@ // eslint-disable-next-line @typescript-eslint/no-require-imports const events = require('events'); +// eslint-disable-next-line @typescript-eslint/no-require-imports +const process = require('node:process'); const EventEmitter = events.EventEmitter; diff --git a/test/tools/runner/filters/api_version_filter.ts b/test/tools/runner/filters/api_version_filter.ts index 4b06c958de3..95b3f9ea56a 100755 --- a/test/tools/runner/filters/api_version_filter.ts +++ b/test/tools/runner/filters/api_version_filter.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { type MongoClient } from '../../../../src'; import { Filter } from './filter'; diff --git a/test/tools/runner/filters/auth_filter.ts b/test/tools/runner/filters/auth_filter.ts index 4fe3cb26a09..dc3d975cdb4 100644 --- a/test/tools/runner/filters/auth_filter.ts +++ b/test/tools/runner/filters/auth_filter.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { Filter } from './filter'; /** diff --git a/test/tools/runner/filters/idms_mock_server_filter.ts b/test/tools/runner/filters/idms_mock_server_filter.ts index 1501878bd0d..2436c55e9b4 100644 --- a/test/tools/runner/filters/idms_mock_server_filter.ts +++ b/test/tools/runner/filters/idms_mock_server_filter.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { get } from 'http'; import { Filter } from './filter'; diff --git a/test/tools/runner/filters/node_version_filter.ts b/test/tools/runner/filters/node_version_filter.ts index 2cc70ea5c13..f6cfb396dba 100644 --- a/test/tools/runner/filters/node_version_filter.ts +++ b/test/tools/runner/filters/node_version_filter.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { satisfies } from 'semver'; import { Filter } from './filter'; diff --git a/test/tools/runner/filters/os_filter.ts b/test/tools/runner/filters/os_filter.ts index 50e6201ed1e..01777555f42 100755 --- a/test/tools/runner/filters/os_filter.ts +++ b/test/tools/runner/filters/os_filter.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { Filter } from './filter'; /** diff --git a/test/tools/runner/hooks/configuration.ts b/test/tools/runner/hooks/configuration.ts index 9fdc5c6c91c..0678f694a5a 100644 --- a/test/tools/runner/hooks/configuration.ts +++ b/test/tools/runner/hooks/configuration.ts @@ -5,6 +5,8 @@ require('source-map-support').install({ hookRequire: true }); +import * as process from 'node:process'; + import { MongoClient } from '../../../../src'; import { AlpineTestConfiguration, AstrolabeTestConfiguration, TestConfiguration } from '../config'; import { getEnvironmentalOptions } from '../../utils'; diff --git a/test/tools/runner/hooks/leak_checker.ts b/test/tools/runner/hooks/leak_checker.ts index b6171d7a204..25d7198c418 100644 --- a/test/tools/runner/hooks/leak_checker.ts +++ b/test/tools/runner/hooks/leak_checker.ts @@ -1,4 +1,7 @@ /* eslint-disable @typescript-eslint/no-this-alias */ + +import * as process from 'node:process'; + import { expect } from 'chai'; import * as chalk from 'chalk'; import * as net from 'net'; diff --git a/test/tools/spec-runner/context.js b/test/tools/spec-runner/context.js index 4c8383e001c..9bcc93acb3f 100644 --- a/test/tools/spec-runner/context.js +++ b/test/tools/spec-runner/context.js @@ -4,6 +4,7 @@ const { setTimeout } = require('timers'); const { resolveConnectionString } = require('./utils'); const { ns } = require('../../../src/utils'); const { extractAuthFromConnectionString } = require('../utils'); +const process = require('node:process'); class Thread { constructor() { diff --git a/test/tools/spec-runner/index.js b/test/tools/spec-runner/index.js index 3a23c439eb1..f8b285aa007 100644 --- a/test/tools/spec-runner/index.js +++ b/test/tools/spec-runner/index.js @@ -2,6 +2,7 @@ const path = require('path'); const fs = require('fs'); const chai = require('chai'); +const process = require('node:process'); const expect = chai.expect; const { EJSON } = require('bson'); diff --git a/test/tools/spec-runner/utils.js b/test/tools/spec-runner/utils.js index 4286a28ebf9..c7e86654e9e 100644 --- a/test/tools/spec-runner/utils.js +++ b/test/tools/spec-runner/utils.js @@ -1,5 +1,6 @@ 'use strict'; +const process = require('node:process'); const { extractAuthFromConnectionString } = require('../utils'); function resolveConnectionString(configuration, spec, context) { diff --git a/test/tools/unified-spec-runner/astrolabe_results_writer.ts b/test/tools/unified-spec-runner/astrolabe_results_writer.ts index 635c22b22f2..de599f69023 100644 --- a/test/tools/unified-spec-runner/astrolabe_results_writer.ts +++ b/test/tools/unified-spec-runner/astrolabe_results_writer.ts @@ -1,4 +1,5 @@ import { writeFile } from 'node:fs/promises'; +import * as process from 'node:process'; import * as path from 'path'; diff --git a/test/tools/unified-spec-runner/entities.ts b/test/tools/unified-spec-runner/entities.ts index 42b9bcd19ef..87fccaf01cf 100644 --- a/test/tools/unified-spec-runner/entities.ts +++ b/test/tools/unified-spec-runner/entities.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { AssertionError, expect } from 'chai'; import { EventEmitter } from 'events'; import { setImmediate } from 'timers'; diff --git a/test/tools/unified-spec-runner/operations.ts b/test/tools/unified-spec-runner/operations.ts index 7605cc4112f..31b41bede1b 100644 --- a/test/tools/unified-spec-runner/operations.ts +++ b/test/tools/unified-spec-runner/operations.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ +import * as process from 'node:process'; import { Readable } from 'node:stream'; import { pipeline } from 'node:stream/promises'; diff --git a/test/tools/unified-spec-runner/runner.ts b/test/tools/unified-spec-runner/runner.ts index a5d8f332cdc..65a2c92f85b 100644 --- a/test/tools/unified-spec-runner/runner.ts +++ b/test/tools/unified-spec-runner/runner.ts @@ -1,4 +1,6 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ +import * as process from 'node:process'; + import { AssertionError, expect } from 'chai'; import { gte as semverGte, satisfies as semverSatisfies } from 'semver'; diff --git a/test/tools/unified-spec-runner/unified-utils.ts b/test/tools/unified-spec-runner/unified-utils.ts index d259a89245f..4278847cb82 100644 --- a/test/tools/unified-spec-runner/unified-utils.ts +++ b/test/tools/unified-spec-runner/unified-utils.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { AssertionError, expect } from 'chai'; import ConnectionString from 'mongodb-connection-string-url'; import { coerce, gte as semverGte, lte as semverLte } from 'semver'; diff --git a/test/tools/utils.ts b/test/tools/utils.ts index d092fe2eca6..d81538bdf64 100644 --- a/test/tools/utils.ts +++ b/test/tools/utils.ts @@ -3,6 +3,7 @@ import { on, once } from 'node:events'; import * as fs from 'node:fs/promises'; import { tmpdir } from 'node:os'; import * as path from 'node:path'; +import * as process from 'node:process'; import { EJSON } from 'bson'; import * as BSON from 'bson'; diff --git a/test/unit/assorted/polling_srv_records_for_mongos_discovery.prose.test.ts b/test/unit/assorted/polling_srv_records_for_mongos_discovery.prose.test.ts index 258e1922fce..e34e4e425c7 100644 --- a/test/unit/assorted/polling_srv_records_for_mongos_discovery.prose.test.ts +++ b/test/unit/assorted/polling_srv_records_for_mongos_discovery.prose.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import * as dns from 'dns'; import { once } from 'events'; diff --git a/test/unit/client-side-encryption/auto_encrypter.test.ts b/test/unit/client-side-encryption/auto_encrypter.test.ts index a7a00beba03..ba02a352cf5 100644 --- a/test/unit/client-side-encryption/auto_encrypter.test.ts +++ b/test/unit/client-side-encryption/auto_encrypter.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { BSON } from 'bson'; import { expect } from 'chai'; import * as fs from 'fs'; diff --git a/test/unit/client-side-encryption/providers/credentialsProvider.test.ts b/test/unit/client-side-encryption/providers/credentialsProvider.test.ts index 5dbca90dfb3..234555c8dec 100644 --- a/test/unit/client-side-encryption/providers/credentialsProvider.test.ts +++ b/test/unit/client-side-encryption/providers/credentialsProvider.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import * as http from 'http'; import * as sinon from 'sinon'; diff --git a/test/unit/client-side-encryption/requirements.helper.ts b/test/unit/client-side-encryption/requirements.helper.ts index 3aa8fa4b36a..2c343dee8c6 100644 --- a/test/unit/client-side-encryption/requirements.helper.ts +++ b/test/unit/client-side-encryption/requirements.helper.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { getAwsCredentialProvider, getGcpMetadata } from '../../../src/deps'; // Data Key Stuff diff --git a/test/unit/cmap/auth/mongodb_oidc/token_machine_workflow.test.ts b/test/unit/cmap/auth/mongodb_oidc/token_machine_workflow.test.ts index 912be77be01..0bec2e10bb5 100644 --- a/test/unit/cmap/auth/mongodb_oidc/token_machine_workflow.test.ts +++ b/test/unit/cmap/auth/mongodb_oidc/token_machine_workflow.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import { callback } from '../../../../../src/cmap/auth/mongodb_oidc/token_machine_workflow'; diff --git a/test/unit/cmap/connect.test.ts b/test/unit/cmap/connect.test.ts index a3e8f7dac36..65d989d6f8a 100644 --- a/test/unit/cmap/connect.test.ts +++ b/test/unit/cmap/connect.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import { MongoCredentials } from '../../../src/cmap/auth/mongo_credentials'; diff --git a/test/unit/mongo_client.test.ts b/test/unit/mongo_client.test.ts index f0d2cd110eb..d2df7cd26c0 100644 --- a/test/unit/mongo_client.test.ts +++ b/test/unit/mongo_client.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import * as fs from 'fs'; import * as os from 'os'; diff --git a/test/unit/mongo_logger.test.ts b/test/unit/mongo_logger.test.ts index c3b1aaec46b..aeb76b0b847 100644 --- a/test/unit/mongo_logger.test.ts +++ b/test/unit/mongo_logger.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { BSONRegExp, Code, Double, EJSON, Int32, MaxKey, MinKey, ObjectId } from 'bson'; import { expect } from 'chai'; import * as sinon from 'sinon'; diff --git a/test/unit/sdam/monitor.test.ts b/test/unit/sdam/monitor.test.ts index 07de7d84ddf..2a5cb2203a0 100644 --- a/test/unit/sdam/monitor.test.ts +++ b/test/unit/sdam/monitor.test.ts @@ -1,5 +1,6 @@ import { once } from 'node:events'; import * as net from 'node:net'; +import * as process from 'node:process'; import { Long, ObjectId } from 'bson'; import { expect } from 'chai'; diff --git a/test/unit/sdam/topology.test.ts b/test/unit/sdam/topology.test.ts index cf0511a8437..49db9f13c41 100644 --- a/test/unit/sdam/topology.test.ts +++ b/test/unit/sdam/topology.test.ts @@ -1,3 +1,5 @@ +import * as process from 'node:process'; + import { expect } from 'chai'; import { once } from 'events'; import * as net from 'net';