Skip to content

Commit

Permalink
build(external-scripts): use latest mongodb native driver
Browse files Browse the repository at this point in the history
  • Loading branch information
Xunnamius committed Jul 29, 2021
1 parent 9dc49b9 commit fd53fef
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
8 changes: 2 additions & 6 deletions external-scripts/is-next-compat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ const setCompatFlagTo = async (version: string) => {
try {
// ? Update database
if (process.env.MONGODB_URI) {
const client = await MongoClient.connect(process.env.MONGODB_URI, {
useUnifiedTopology: true
});
const client = await MongoClient.connect(process.env.MONGODB_URI);

await client
.db()
Expand All @@ -50,9 +48,7 @@ const getLastTestedVersion = async () => {
try {
// ? Update database
if (process.env.MONGODB_URI) {
const client = await MongoClient.connect(process.env.MONGODB_URI, {
useUnifiedTopology: true
});
const client = await MongoClient.connect(process.env.MONGODB_URI);

version =
(
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@
"@types/edit-json-file": "^1.4.1",
"@types/find-package-json": "^1.2.2",
"@types/jest": "^26.0.24",
"@types/mongodb": "^4.0.6",
"@types/node": "^16.4.7",
"@types/semver": "^7.3.8",
"@types/test-listen": "^1.1.0",
Expand Down
9 changes: 4 additions & 5 deletions test/integration-external.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@ it(`runs silent by default`, async () => {
expect.hasAssertions();

await withMockedFixture(async ({ root }) => {
const { code, stdout } = await runExternal(undefined, { cwd: root });
const { code, stdout, stderr } = await runExternal(undefined, { cwd: root });

expect(code).toBe(0);
expect(stdout).toBeEmpty();
// eslint-disable-next-line jest/no-conditional-expect
// TODO: uncomment once mongodb driver devs stop fucking up
//!process.env.DEBUG && expect(stderr).toBeEmpty();
!process.env.DEBUG && expect(stderr).toBeEmpty();
expect(code).toBe(0);
});
});

Expand All @@ -59,8 +58,8 @@ it(`is verbose when DEBUG='${debugId}'`, async () => {
cwd: root
});

expect(code).toBe(0);
expect(stdout).toBeEmpty();
expect(stderr).toStrictEqual(expect.stringContaining('execution complete'));
expect(code).toBe(0);
});
});

0 comments on commit fd53fef

Please sign in to comment.