Skip to content

Commit f33f832

Browse files
committed
chore: turn the testing folder into a package
1 parent fc4c412 commit f33f832

Some content is hidden

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

51 files changed

+182
-69
lines changed

package-lock.json

Lines changed: 38 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cli-repl/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@
113113
"eslint": "^7.25.0",
114114
"mongodb-crypt-library-dummy": "^1.0.2",
115115
"prettier": "^2.8.8",
116-
"webpack-merge": "^5.8.0"
116+
"webpack-merge": "^5.8.0",
117+
"@mongosh/testing": "0.0.0-dev.0"
117118
},
118119
"optionalDependencies": {
119120
"get-console-process-list": "^1.0.5",

packages/cli-repl/src/cli-repl.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import path from 'path';
88
import type { Duplex } from 'stream';
99
import { PassThrough } from 'stream';
1010
import { promisify } from 'util';
11-
import { eventually } from '../../../testing/eventually';
12-
import type { MongodSetup } from '../../../testing/integration-testing-hooks';
1311
import {
12+
eventually,
13+
type MongodSetup,
1414
skipIfServerVersion,
1515
startSharedTestServer,
1616
startTestServer,
17-
} from '../../../testing/integration-testing-hooks';
17+
} from '@mongosh/testing';
1818
import {
1919
expect,
2020
fakeTTYProps,

packages/cli-repl/src/smoke-tests.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import path from 'path';
33
import {
44
downloadCurrentCryptSharedLibrary,
55
startSharedTestServer,
6-
} from '../../../testing/integration-testing-hooks';
6+
} from '@mongosh/testing';
77

88
describe('smoke tests', function () {
99
const testServer = startSharedTestServer();

packages/connectivity-tests/test/atlas.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ function test_srv_without_nodejs_dns() {
136136

137137
CONNECTION_STRING="mongodb+srv://${ATLAS_USERNAME}:${ATLAS_PASSWORD}@${ATLAS_HOSTNAME}/admin"
138138

139-
echo "${CONNECTION_STATUS_COMMAND}" | NODE_OPTIONS="-r ${MONGOSH_ROOT_DIR}/testing/disable-dns-srv.js" "${MONGOSH}" "${CONNECTION_STRING}" |
139+
echo "${CONNECTION_STATUS_COMMAND}" | NODE_OPTIONS="-r ${MONGOSH_ROOT_DIR}/packages/connectivity-tests/scripts/disable-dns-srv.js" "${MONGOSH}" "${CONNECTION_STRING}" |
140140
grep -Fq "${CONNECTION_STATUS_CHECK_STRING}" ||
141141
FAILED="Can't connect to Atlas using connection string without Node.js SRV/TXT DNS support"
142142

packages/e2e-tests/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"mongodb": "^6.19.0",
5151
"node-fetch": "^3.3.2",
5252
"prettier": "^2.8.8",
53-
"rimraf": "^3.0.2"
53+
"rimraf": "^3.0.2",
54+
"@mongosh/testing": "0.0.0-dev.0"
5455
}
5556
}

packages/e2e-tests/test/e2e-analytics.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { expect } from 'chai';
2-
import { startTestCluster } from '../../../testing/integration-testing-hooks';
3-
import { eventually } from '../../../testing/eventually';
2+
import { startTestCluster, eventually } from '@mongosh/testing';
43

54
describe('e2e Analytics Node', function () {
65
const replSetName = 'replicaSet';

packages/e2e-tests/test/e2e-auth.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { expect } from 'chai';
22
import type { Db, Document, MongoClientOptions } from 'mongodb';
33
import { MongoClient } from 'mongodb';
4-
import { eventually } from '../../../testing/eventually';
5-
import type { TestShell } from './test-shell';
64
import {
5+
eventually,
76
skipIfApiStrict,
87
startSharedTestServer,
9-
} from '../../../testing/integration-testing-hooks';
8+
} from '@mongosh/testing';
9+
import type { TestShell } from './test-shell';
1010

1111
type AssertUserExists = (opts?: Document, username?: string) => Promise<void>;
1212
function createAssertUserExists(db: Db, dbName: string): AssertUserExists {

packages/e2e-tests/test/e2e-banners.spec.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import {
2-
skipIfApiStrict,
3-
startSharedTestServer,
4-
} from '../../../testing/integration-testing-hooks';
1+
import { skipIfApiStrict, startSharedTestServer } from '@mongosh/testing';
52
import type { TestShell } from './test-shell';
63

74
describe('e2e startup banners', function () {

0 commit comments

Comments
 (0)