Skip to content

Commit b5d1c94

Browse files
committed
Replace cross-spawn with shell:true
1 parent c439402 commit b5d1c94

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
"test": "jest --coverage",
88
"posttest": "npm run build",
99
"build": "node build.js",
10-
"eslint:examples": "eslint --rulesdir src --no-ignore --fix-dry-run --format json --report-unused-disable-directives examples --ext .js,.ts,.vue,.md"
10+
"examples": "eslint --rulesdir src --no-ignore --fix-dry-run --format json --report-unused-disable-directives examples --ext .js,.ts,.vue,.md"
1111
},
1212
"devDependencies": {
1313
"@typescript-eslint/parser": "4.6.1",
1414
"babel-eslint": "10.1.0",
15-
"cross-spawn": "7.0.3",
1615
"doctoc": "1.4.0",
1716
"eslint": "7.13.0",
1817
"eslint-plugin-import": "2.22.1",

test/examples.test.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
"use strict";
22

3+
const childProcess = require("child_process");
34
const path = require("path");
4-
5-
const spawn = require("cross-spawn");
65
const prettier = require("prettier");
76

87
// Make snapshots easier to read.
@@ -14,9 +13,14 @@ expect.addSnapshotSerializer({
1413
});
1514

1615
describe("examples", () => {
17-
const result = spawn.sync("npm", ["run", "eslint:examples", "--silent"], {
18-
encoding: "utf8",
19-
});
16+
const result = childProcess.spawnSync(
17+
"npm",
18+
["run", "examples", "--silent"],
19+
{
20+
encoding: "utf8",
21+
shell: true, // For Windows.
22+
}
23+
);
2024

2125
const output = JSON.parse(result.stdout);
2226

0 commit comments

Comments
 (0)