Remove lodash from @babel/node tests (#13025)

This commit is contained in:
Justin Ridgewell 2021-03-19 10:53:13 -04:00 committed by GitHub
parent 830a93cc97
commit e2244c92d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 7 deletions

View File

@ -26,7 +26,6 @@
"@babel/register": "workspace:^7.13.8", "@babel/register": "workspace:^7.13.8",
"commander": "^4.0.1", "commander": "^4.0.1",
"core-js": "^3.2.1", "core-js": "^3.2.1",
"lodash": "^4.17.19",
"node-environment-flags": "^1.0.5", "node-environment-flags": "^1.0.5",
"regenerator-runtime": "^0.13.4", "regenerator-runtime": "^0.13.4",
"v8flags": "^3.1.1" "v8flags": "^3.1.1"

View File

@ -1,10 +1,8 @@
import includes from "lodash/includes";
import readdir from "fs-readdir-recursive"; import readdir from "fs-readdir-recursive";
import * as helper from "@babel/helper-fixtures"; import * as helper from "@babel/helper-fixtures";
import rimraf from "rimraf"; import rimraf from "rimraf";
import { sync as makeDirSync } from "make-dir"; import { sync as makeDirSync } from "make-dir";
import child from "child_process"; import child from "child_process";
import merge from "lodash/merge";
import path from "path"; import path from "path";
import fs from "fs"; import fs from "fs";
import { fileURLToPath } from "url"; import { fileURLToPath } from "url";
@ -51,7 +49,7 @@ const assertTest = function (stdout, stderr, opts) {
if (opts.stderr) { if (opts.stderr) {
if (opts.stderrContains) { if (opts.stderrContains) {
expect(includes(stderr, expectStderr)).toBeTruthy(); expect(stderr.includes(expectStderr)).toBeTruthy();
} else { } else {
expect(stderr).toBe(expectStderr); expect(stderr).toBe(expectStderr);
} }
@ -65,7 +63,7 @@ const assertTest = function (stdout, stderr, opts) {
if (opts.stdout) { if (opts.stdout) {
if (opts.stdoutContains) { if (opts.stdoutContains) {
expect(includes(stdout, expectStdout)).toBeTruthy(); expect(stdout.includes(expectStdout)).toBeTruthy();
} else { } else {
expect(stdout).toBe(expectStdout); expect(stdout).toBe(expectStdout);
} }
@ -176,7 +174,7 @@ fs.readdirSync(fixtureLoc).forEach(function (binName) {
}; };
const optionsLoc = path.join(testLoc, "options.json"); const optionsLoc = path.join(testLoc, "options.json");
if (fs.existsSync(optionsLoc)) merge(opts, require(optionsLoc)); if (fs.existsSync(optionsLoc)) Object.assign(opts, require(optionsLoc));
["stdout", "stdin", "stderr"].forEach(function (key) { ["stdout", "stdin", "stderr"].forEach(function (key) {
const loc = path.join(testLoc, key + ".txt"); const loc = path.join(testLoc, key + ".txt");

View File

@ -939,7 +939,6 @@ __metadata:
commander: ^4.0.1 commander: ^4.0.1
core-js: ^3.2.1 core-js: ^3.2.1
fs-readdir-recursive: ^1.0.0 fs-readdir-recursive: ^1.0.0
lodash: ^4.17.19
make-dir: ^2.1.0 make-dir: ^2.1.0
node-environment-flags: ^1.0.5 node-environment-flags: ^1.0.5
regenerator-runtime: ^0.13.4 regenerator-runtime: ^0.13.4