Skip to content

Commit c357acf

Browse files
authored
test(NODE-4975): missing mongodb test imports (#3522)
1 parent 1f1a72b commit c357acf

File tree

92 files changed

+168
-132
lines changed

Some content is hidden

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

92 files changed

+168
-132
lines changed

.eslintrc.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,18 @@
192192
"rules": {
193193
"no-console": "off",
194194
"no-restricted-syntax": "off",
195-
"typescript-eslint/ban-ts-comment": "off"
195+
"typescript-eslint/ban-ts-comment": "off",
196+
"no-restricted-imports": "off",
197+
"@typescript-eslint/no-restricted-imports": [
198+
"error",
199+
{
200+
"patterns": [
201+
"**/../lib/**",
202+
"**/../src/**",
203+
"mongodb-mock-server"
204+
]
205+
}
206+
]
196207
}
197208
},
198209
{
@@ -227,7 +238,6 @@
227238
{
228239
"patterns": [
229240
"**/../lib/**",
230-
"**/../src/**",
231241
"mongodb-mock-server"
232242
]
233243
}

test/integration/auth/mongodb_aws.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as http from 'http';
33
import { performance } from 'perf_hooks';
44
import * as sinon from 'sinon';
55

6-
import { MongoAWSError, MongoClient, MongoServerError } from '../../../src';
6+
import { MongoAWSError, MongoClient, MongoServerError } from '../../mongodb';
77
import { removeAuthFromConnectionString } from '../../tools/utils';
88

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

test/integration/auth/scram_sha_1.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect } from 'chai';
22

3-
import type { MongoClient } from '../../../src';
3+
import type { MongoClient } from '../../mongodb';
44

55
describe('SCRAM-SHA-1', function () {
66
let client: MongoClient;

test/integration/auth/ssl_x509_connect.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const fs = require('fs');
33
const { format: f } = require('util');
44
const { test, setupDatabase } = require('../shared');
55
const { expect } = require('chai');
6-
const { MongoClient } = require('../../../src');
6+
const { MongoClient } = require('../../mongodb');
77

88
describe('SSL (x509)', function () {
99
before(function () {

test/integration/bson-decimal128/decimal128.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
const { assert: test } = require('../shared');
33
const { expect } = require('chai');
44
const { setupDatabase } = require('../shared');
5-
const { Decimal128 } = require('../../../src');
5+
const { Decimal128 } = require('../../mongodb');
66

77
describe('Decimal128', function () {
88
before(function () {

test/integration/change-streams/change_stream.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ import {
1414
Collection,
1515
CommandStartedEvent,
1616
Db,
17+
isHello,
1718
Long,
1819
MongoAPIError,
1920
MongoChangeStreamError,
2021
MongoClient,
2122
MongoServerError,
2223
ReadPreference,
2324
ResumeToken
24-
} from '../../../src';
25-
import { isHello } from '../../mongodb';
25+
} from '../../mongodb';
2626
import * as mock from '../../tools/mongodb-mock/index';
2727
import {
2828
FailPoint,

test/integration/change-streams/change_streams.prose.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ import {
88
CommandStartedEvent,
99
CommandSucceededEvent,
1010
Document,
11+
isHello,
12+
LEGACY_HELLO_COMMAND,
1113
Long,
1214
MongoNetworkError,
1315
ObjectId,
1416
Timestamp
15-
} from '../../../src';
16-
import { isHello, LEGACY_HELLO_COMMAND } from '../../mongodb';
17+
} from '../../mongodb';
1718
import * as mock from '../../tools/mongodb-mock/index';
1819
import { setupDatabase } from '../shared';
1920

test/integration/client-side-encryption/driver.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { EJSON, UUID } from 'bson';
22
import { expect } from 'chai';
33
import * as crypto from 'crypto';
44

5-
import { Collection, CommandStartedEvent, MongoClient } from '../../../src';
5+
import { Collection, CommandStartedEvent, MongoClient } from '../../mongodb';
66
import * as BSON from '../../mongodb';
77
import { installNodeDNSWorkaroundHooks } from '../../tools/runner/hooks/configuration';
88
import { ClientEncryption } from '../../tools/unified-spec-runner/schema';

test/integration/collection-management/collection.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { expect } from 'chai';
22

3-
import { Collection, Db, MongoClient } from '../../../src';
4-
import { isHello } from '../../mongodb';
3+
import { Collection, Db, isHello, MongoClient } from '../../mongodb';
54
import * as mock from '../../tools/mongodb-mock/index';
65
import { setupDatabase } from '../shared';
76

test/integration/connection-monitoring-and-pooling/connection.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import { expect } from 'chai';
22

3-
import { MongoClient, MongoServerError, ServerHeartbeatStartedEvent } from '../../../src';
43
import {
54
connect,
65
Connection,
76
HostAddress,
87
LEGACY_HELLO_COMMAND,
8+
MongoClient,
9+
MongoServerError,
910
ns,
11+
ServerHeartbeatStartedEvent,
1012
Topology
1113
} from '../../mongodb';
1214
import { skipBrokenAuthTestBeforeEachHook } from '../../tools/runner/hooks/configuration';

test/integration/connections-survive-step-down/connections_survive_step_down.prose.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect } from 'chai';
22

3-
import type { Collection, Db, MongoClient } from '../../../src';
3+
import type { Collection, Db, MongoClient } from '../../mongodb';
44
import { skipBrokenAuthTestBeforeEachHook } from '../../tools/runner/hooks/configuration';
55

66
function ignoreNsNotFound(err) {

test/integration/crud/bulk.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
MongoClient,
99
MongoDriverError,
1010
MongoInvalidArgumentError
11-
} from '../../../src';
11+
} from '../../mongodb';
1212
import { assert as test, ignoreNsNotFound } from '../shared';
1313

1414
const MAX_BSON_SIZE = 16777216;

test/integration/crud/crud.prose.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const { expect } = require('chai');
22
const { once } = require('events');
3-
const { MongoBulkWriteError, MongoServerError } = require('../../../src');
3+
const { MongoBulkWriteError, MongoServerError } = require('../../mongodb');
44

55
describe('CRUD Prose Spec Tests', () => {
66
let client;

test/integration/crud/crud_api.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect } from 'chai';
22

3-
import { MongoClient, MongoError, ObjectId, ReturnDocument } from '../../../src';
3+
import { MongoClient, MongoError, ObjectId, ReturnDocument } from '../../mongodb';
44
import { assert as test } from '../shared';
55

66
// instanceof cannot be use reliably to detect the new models in js due to scoping and new

test/integration/crud/explain.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22
const { setupDatabase } = require('../shared');
3-
const { MongoServerError } = require('../../../src');
3+
const { MongoServerError } = require('../../mongodb');
44
const chai = require('chai');
55

66
const expect = chai.expect;

test/integration/crud/find.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const { assert: test } = require('../shared');
33
const { expect } = require('chai');
44
const sinon = require('sinon');
55
const { setTimeout } = require('timers');
6-
const { Code, ObjectId, Long, Binary, ReturnDocument } = require('../../../src');
6+
const { Code, ObjectId, Long, Binary, ReturnDocument } = require('../../mongodb');
77

88
describe('Find', function () {
99
let client;

test/integration/crud/insert.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const {
1919
Code,
2020
MongoBulkWriteError,
2121
ReturnDocument
22-
} = require('../../../src');
22+
} = require('../../mongodb');
2323

2424
/**
2525
* Module for parsing an ISO 8601 formatted string into a Date object.

test/integration/crud/maxTimeMS.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
MongoClient,
99
MongoCursorExhaustedError,
1010
MongoServerError
11-
} from '../../../src';
11+
} from '../../mongodb';
1212
import { getSymbolFrom } from '../../tools/utils';
1313

1414
describe('MaxTimeMS', function () {

test/integration/crud/pk_factory.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
const { expect } = require('chai');
33
const { setupDatabase } = require('../../integration/shared');
4-
const { ObjectId } = require('../../../src');
4+
const { ObjectId } = require('../../mongodb');
55

66
describe('PkFactory', function () {
77
before(function () {

test/integration/crud/server_errors.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const chai = require('chai');
44

55
const expect = chai.expect;
66
const sinonChai = require('sinon-chai');
7-
const { MongoServerError } = require('../../../src');
7+
const { MongoServerError } = require('../../mongodb');
88

99
chai.use(sinonChai);
1010

test/integration/enumerate_databases.prose.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect } from 'chai';
22

3-
import type { MongoClient } from '../../src';
3+
import type { MongoClient } from '../mongodb';
44

55
const REQUIRED_DBS = ['admin', 'local', 'config'];
66
const DB_NAME = 'listDatabasesTest';

test/integration/enumerate_databases.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect } from 'chai';
22

3-
import { AddUserOptions, MongoClient, MongoServerError } from '../../src';
3+
import { AddUserOptions, MongoClient, MongoServerError } from '../mongodb';
44
import { TestBuilder, UnifiedTestSuiteBuilder } from '../tools/utils';
55

66
const metadata: MongoDBMetadataUI = {

test/integration/gridfs/gridfs.spec.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const { EJSON } = require('bson');
44
const { setupDatabase } = require('./../shared');
55
const { expect } = require('chai');
6-
const { GridFSBucket } = require('../../../src');
6+
const { GridFSBucket } = require('../../mongodb');
77

88
describe('GridFS spec', function () {
99
before(function () {

test/integration/gridfs/gridfs.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { expect } from 'chai';
22
import { once } from 'events';
33

4-
import { type Db, type MongoClient, CommandStartedEvent, GridFSBucket } from '../../../src';
4+
import { type Db, type MongoClient, CommandStartedEvent, GridFSBucket } from '../../mongodb';
55
import { sleep } from '../../tools/utils';
66

77
describe('GridFS', () => {

test/integration/gridfs/gridfs_stream.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const { Double } = require('bson');
44
const stream = require('stream');
55
const fs = require('fs');
66
const { expect } = require('chai');
7-
const { GridFSBucket, ObjectId } = require('../../../src');
7+
const { GridFSBucket, ObjectId } = require('../../mongodb');
88
const sinon = require('sinon');
99
const { sleep } = require('../../tools/utils');
1010

test/integration/initial-dns-seedlist-discovery/initial_dns_seedlist_discovery.spec.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import * as fs from 'fs';
44
import * as path from 'path';
55
import { promisify } from 'util';
66

7-
import { MongoClient } from '../../../src';
8-
import { HostAddress } from '../../mongodb';
7+
import { HostAddress, MongoClient } from '../../mongodb';
98

109
function makeTest(test, topology) {
1110
let client;

test/integration/max-staleness/max_staleness.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
const { Long } = require('bson');
33
const { expect } = require('chai');
44
const mock = require('../../tools/mongodb-mock/index');
5-
const { ReadPreference } = require('../../../src');
5+
const { ReadPreference } = require('../../mongodb');
66
const { isHello } = require('../../mongodb');
77

88
const test = {};

test/integration/node-specific/abstract_cursor.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { expect } from 'chai';
22
import { inspect } from 'util';
33

4-
import { Collection, MongoAPIError, MongoClient } from '../../../src';
4+
import { Collection, MongoAPIError, MongoClient } from '../../mongodb';
55

66
const falseyValues = [0, 0n, NaN, '', false, undefined];
77

test/integration/node-specific/auto_connect.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import { once } from 'events';
44
import {
55
BSONType,
66
ChangeStream,
7+
ClientSession,
78
Collection,
89
MongoClient,
910
MongoNotConnectedError,
1011
ProfilingLevel,
12+
Topology,
1113
TopologyType
12-
} from '../../../src';
13-
import { ClientSession, Topology } from '../../mongodb';
14+
} from '../../mongodb';
1415

1516
describe('When executing an operation for the first time', () => {
1617
let client: MongoClient;

test/integration/node-specific/bson-options/ignore_undefined.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
const { expect } = require('chai');
33
const { assert: test, setupDatabase } = require('../../shared');
4-
const { ObjectId } = require('../../../../src');
4+
const { ObjectId } = require('../../../mongodb');
55

66
describe('Ignore Undefined', function () {
77
before(function () {

test/integration/node-specific/bson-options/promote_values.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22
const { expect } = require('chai');
3-
const { Long, Int32, Double } = require('../../../../src');
3+
const { Long, Int32, Double } = require('../../../mongodb');
44
const { assert: test, setupDatabase } = require('../../shared');
55

66
describe('Promote Values', function () {

test/integration/node-specific/bson-options/raw.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect } from 'chai';
22

3-
import { Collection, MongoClient, MongoCompatibilityError, ObjectId } from '../../../../src';
3+
import { Collection, MongoClient, MongoCompatibilityError, ObjectId } from '../../../mongodb';
44

55
describe('raw bson support', () => {
66
describe('raw', () => {

test/integration/node-specific/comment_with_falsy_values.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect } from 'chai';
22

3-
import { Collection, CommandStartedEvent, Long, MongoClient } from '../../../src';
3+
import { Collection, CommandStartedEvent, Long, MongoClient } from '../../mongodb';
44
import { TestBuilder, UnifiedTestSuiteBuilder } from '../../tools/utils';
55

66
const falsyValues = [0, false, '', Long.ZERO, null, NaN] as const;

test/integration/node-specific/cursor_stream.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22
const { expect } = require('chai');
3-
const { Binary } = require('../../../src');
3+
const { Binary } = require('../../mongodb');
44
const { setTimeout, setImmediate } = require('timers');
55

66
describe('Cursor Streams', function () {

test/integration/node-specific/db.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const { setupDatabase, assert: test } = require(`../shared`);
44
const { expect } = require('chai');
5-
const { Db, MongoClient } = require('../../../src');
5+
const { Db, MongoClient } = require('../../mongodb');
66

77
describe('Db', function () {
88
before(function () {

test/integration/node-specific/examples/transactions.test.js

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

3-
const { MongoClient } = require('../../../../src');
3+
const { MongoClient } = require('../../../mongodb');
44

55
// Yes, we are shadowing a global here but we are not actually ever printing anything in this file
66
// This just so the examples can use console.log to make for nice copy pasting

test/integration/node-specific/examples/versioned_api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
2-
const { MongoClient } = require('../../../../src');
2+
const { MongoClient } = require('../../../mongodb');
33

44
describe('examples.versionedApi:', function () {
55
let uri;

test/integration/node-specific/feature_flags.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { expect } from 'chai';
22

3-
import { MongoClient } from '../../../src';
4-
import { MongoLoggableComponent, SeverityLevel } from '../../mongodb';
3+
import { MongoClient, MongoLoggableComponent, SeverityLevel } from '../../mongodb';
54

65
describe('Feature Flags', () => {
76
describe('@@mdb.skipPingOnConnect', () => {

test/integration/node-specific/ipv6.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as net from 'net';
33
import * as process from 'process';
44
import * as sinon from 'sinon';
55

6-
import { ConnectionCreatedEvent, MongoClient, ReadPreference, TopologyType } from '../../../src';
6+
import { ConnectionCreatedEvent, MongoClient, ReadPreference, TopologyType } from '../../mongodb';
77

88
describe('IPv6 Addresses', () => {
99
let client: MongoClient;

0 commit comments

Comments
 (0)