Skip to content

Commit

Permalink
Fix tests on Node.js 12
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Nov 17, 2021
1 parent 4135df6 commit 7b2bdae
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Expand Up @@ -31,7 +31,7 @@ export default function verifyAndAssertMessages(
"../../../babel-eslint-shared-fixtures/config/babel.config.js",
),
},
...overrideConfig?.parserOptions,
...(overrideConfig && overrideConfig.parserOptions),
},
});

Expand Down
2 changes: 1 addition & 1 deletion packages/babel-cli/test/index.js
Expand Up @@ -123,7 +123,7 @@ const assertTest = function (stdout, stderr, opts, cwd) {
const expected = opts.outFiles[filename];
const actual = actualFiles[filename];

expect(actual).toBe(expected ?? "");
expect(actual).toBe(expected || "");
}
} catch (e) {
e.message += "\n at " + filename;
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-core/test/config-chain.js
Expand Up @@ -14,7 +14,7 @@ import { isMJS, loadOptionsAsync, skipUnsupportedESM } from "./helpers/esm.js";
// TODO: In Babel 8, we can directly uses fs.promises which is supported by
// node 8+
const pfs =
fs.promises ??
fs.promises ||
new Proxy(fs, {
get(target, name) {
if (name === "copyFile") {
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-parser/test/helpers/runFixtureTests.js
Expand Up @@ -218,7 +218,7 @@ function runTest(test, parseFunction, compareErrorsOnly = false) {
return save(test, ast);
}

if (ast.errors?.length) {
if (ast.errors && ast.errors.length) {
throw new Error(
`Expected non-recoverable error message: ${
opts.throws
Expand Down

0 comments on commit 7b2bdae

Please sign in to comment.