diff --git a/package.json b/package.json index 83a9950..a7d77c3 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/test/examples.test.js b/test/examples.test.js index 80b32b6..91ede25 100644 --- a/test/examples.test.js +++ b/test/examples.test.js @@ -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. @@ -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);