Skip to content

Commit

Permalink
Replace cross-spawn with shell:true
Browse files Browse the repository at this point in the history
  • Loading branch information
lydell committed Nov 7, 2020
1 parent c439402 commit b5d1c94
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
"test": "jest --coverage",
"posttest": "npm run build",
"build": "node build.js",
"eslint:examples": "eslint --rulesdir src --no-ignore --fix-dry-run --format json --report-unused-disable-directives examples --ext .js,.ts,.vue,.md"
"examples": "eslint --rulesdir src --no-ignore --fix-dry-run --format json --report-unused-disable-directives examples --ext .js,.ts,.vue,.md"
},
"devDependencies": {
"@typescript-eslint/parser": "4.6.1",
"babel-eslint": "10.1.0",
"cross-spawn": "7.0.3",
"doctoc": "1.4.0",
"eslint": "7.13.0",
"eslint-plugin-import": "2.22.1",
Expand Down
14 changes: 9 additions & 5 deletions test/examples.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"use strict";

const childProcess = require("child_process");
const path = require("path");

const spawn = require("cross-spawn");
const prettier = require("prettier");

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

describe("examples", () => {
const result = spawn.sync("npm", ["run", "eslint:examples", "--silent"], {
encoding: "utf8",
});
const result = childProcess.spawnSync(
"npm",
["run", "examples", "--silent"],
{
encoding: "utf8",
shell: true, // For Windows.
}
);

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

Expand Down

0 comments on commit b5d1c94

Please sign in to comment.