Skip to content

Commit

Permalink
Use npm-exce to invoke Cypress
Browse files Browse the repository at this point in the history
This bypasses EINVAL [1] errors seen in CI on Windows.

[1] https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
  • Loading branch information
badeball committed Jun 6, 2024
1 parent 982ee5e commit a92e791
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions features/support/world.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import ICustomWorld, { ExtraOptions } from "./ICustomWorld";

const projectPath = path.join(__dirname, "..", "..");

const isWin = process.platform === "win32";

function combine(...streams: Readable[]) {
return streams.reduce<PassThrough>((combined, stream) => {
stream.pipe(combined, { end: false });
Expand Down Expand Up @@ -39,13 +37,8 @@ export default class CustomWorld implements ICustomWorld {
expectedExitCode,
}: ExtraOptions = {}) {
return this.runCommand({
cmd: path.join(
projectPath,
"node_modules",
".bin",
isWin ? "cypress.cmd" : "cypress"
),
args: ["run", ...extraArgs],
cmd: "npm",
args: ["exec", "--", "cypress", "run", ...extraArgs],
extraEnv: {
NO_COLOR: "1",
...extraEnv,
Expand Down

0 comments on commit a92e791

Please sign in to comment.