Skip to content

Commit e6a0e14

Browse files
authored
test(NODE-4918): import all driver APIs from one registry file (#3510)
1 parent 83bce00 commit e6a0e14

File tree

138 files changed

+564
-490
lines changed

Some content is hidden

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

138 files changed

+564
-490
lines changed

.eslintrc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@
169169
{
170170
"patterns": [
171171
"**/../lib/**",
172+
"**/../src/**",
172173
"mongodb-mock-server"
173174
]
174175
}
@@ -220,6 +221,16 @@
220221
"@typescript-eslint/return-await": [
221222
"error",
222223
"in-try-catch"
224+
],
225+
"no-restricted-imports": [
226+
"error",
227+
{
228+
"patterns": [
229+
"**/../lib/**",
230+
"**/../src/**",
231+
"mongodb-mock-server"
232+
]
233+
}
223234
]
224235
}
225236
},

.evergreen/install-dependencies.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -o errexit # Exit the script with error if any of the commands fail
44
NVM_WINDOWS_URL="https://github.com/coreybutler/nvm-windows/releases/download/1.1.9/nvm-noinstall.zip"
55
NVM_URL="https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh"
66

7-
NODE_LTS_NAME=${NODE_LTS_NAME:-erbium}
7+
NODE_LTS_NAME=${NODE_LTS_NAME:-fermium}
88
MSVS_VERSION=${MSVS_VERSION:-2019}
99
NODE_ARTIFACTS_PATH="${PROJECT_DIRECTORY}/node-artifacts"
1010
NPM_CACHE_DIR="${NODE_ARTIFACTS_PATH}/npm"
@@ -21,9 +21,6 @@ mkdir -p "${NPM_TMP_DIR}"
2121

2222
function node_lts_to_version() {
2323
case $1 in
24-
"erbium")
25-
echo 12
26-
;;
2724
"fermium")
2825
echo 14
2926
;;

src/cmap/connection.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -95,22 +95,6 @@ export interface CommandOptions extends BSONSerializeOptions {
9595
writeConcern?: WriteConcern;
9696
}
9797

98-
/** @internal */
99-
export interface GetMoreOptions extends CommandOptions {
100-
batchSize?: number;
101-
maxTimeMS?: number;
102-
maxAwaitTimeMS?: number;
103-
/**
104-
* Comment to apply to the operation.
105-
*
106-
* In server versions pre-4.4, 'comment' must be string. A server
107-
* error will be thrown if any other type is provided.
108-
*
109-
* In server versions 4.4 and above, 'comment' can be any valid BSON type.
110-
*/
111-
comment?: unknown;
112-
}
113-
11498
/** @public */
11599
export interface ProxyOptions {
116100
proxyHost?: string;

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ export type {
224224
ConnectionEvents,
225225
ConnectionOptions,
226226
DestroyOptions,
227-
GetMoreOptions,
228227
ProxyOptions
229228
} from './cmap/connection';
230229
export type {

src/sdam/server.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Document } from '../bson';
2-
import { CommandOptions, Connection, DestroyOptions, GetMoreOptions } from '../cmap/connection';
2+
import { CommandOptions, Connection, DestroyOptions } from '../cmap/connection';
33
import {
44
ConnectionPool,
55
ConnectionPoolEvents,
@@ -38,6 +38,7 @@ import {
3838
import { Logger } from '../logger';
3939
import type { ServerApi } from '../mongo_client';
4040
import { TypedEventEmitter } from '../mongo_types';
41+
import type { GetMoreOptions } from '../operations/get_more';
4142
import type { ClientSession } from '../sessions';
4243
import { isTransactionCommand } from '../transactions';
4344
import {
@@ -503,7 +504,7 @@ function makeOperationHandler(
503504
return callback(undefined, result);
504505
}
505506

506-
if (options?.noResponse === true) {
507+
if (options != null && 'noResponse' in options && options.noResponse === true) {
507508
return callback(undefined, null);
508509
}
509510

test/integration/auth/auth.prose.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
const sinon = require('sinon');
44
const { expect } = require('chai');
5-
const { Connection } = require('../../../src/cmap/connection');
6-
const { ScramSHA256 } = require('../../../src/cmap/auth/scram');
5+
const { Connection } = require('../../mongodb');
6+
const { ScramSHA256 } = require('../../mongodb');
77
const { setupDatabase } = require('../shared');
8-
const { LEGACY_HELLO_COMMAND } = require('../../../src/constants');
8+
const { LEGACY_HELLO_COMMAND } = require('../../mongodb');
99

1010
// TODO(NODE-4338): withClient usage prevented these tests from running
1111
// the import has been removed since the function is being deleted, this is here to keep modifications minimal

test/integration/auth/scram_sha_256.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
const sinon = require('sinon');
44
const { expect } = require('chai');
5-
const { Connection } = require('../../../src/cmap/connection');
6-
const { ScramSHA256 } = require('../../../src/cmap/auth/scram');
5+
const { Connection } = require('../../mongodb');
6+
const { ScramSHA256 } = require('../../mongodb');
77
const { setupDatabase } = require('../shared');
8-
const { LEGACY_HELLO_COMMAND } = require('../../../src/constants');
8+
const { LEGACY_HELLO_COMMAND } = require('../../mongodb');
99

1010
// TODO(NODE-4338): withClient usage prevented these tests from running
1111
// the import has been removed since the function is being deleted, this is here to keep modifications minimal

test/integration/causal-consistency/causal_consistency.prose.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 { LEGACY_HELLO_COMMAND } = require('../../../src/constants');
3+
const { LEGACY_HELLO_COMMAND } = require('../../mongodb');
44

55
const { setupDatabase } = require('../shared');
66
const { expect } = require('chai');

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
ReadPreference,
2323
ResumeToken
2424
} from '../../../src';
25-
import { isHello } from '../../../src/utils';
25+
import { isHello } 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: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ import {
1313
ObjectId,
1414
Timestamp
1515
} from '../../../src';
16-
import { LEGACY_HELLO_COMMAND } from '../../../src/constants';
17-
import { isHello } from '../../../src/utils';
16+
import { isHello, LEGACY_HELLO_COMMAND } from '../../mongodb';
1817
import * as mock from '../../tools/mongodb-mock/index';
1918
import { setupDatabase } from '../shared';
2019

0 commit comments

Comments
 (0)