Skip to content

Commit ef58a8d

Browse files
committed
test: fix
1 parent b73f797 commit ef58a8d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/api/prompt.test.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const { resolve } = require("path");
33
// eslint-disable-next-line node/no-unpublished-require
44
const execa = require("execa");
55
const { Writable } = require("stream");
6+
const { isWindows } = require("../utils/test-utils");
67

78
describe("prompt", () => {
89
class MyWritable extends Writable {
@@ -76,16 +77,19 @@ describe("prompt", () => {
7677
});
7778

7879
it("should respond to SIGINT", async () => {
79-
const test = resolve(__dirname, "./helpers/runAndKillPrompt.js");
80+
const runAndKillPrompt = resolve(__dirname, "./helpers/runAndKillPrompt.js");
8081

81-
const { exitCode, stderr, stdout } = await execa("node", [test], {
82+
const { exitCode, stderr, stdout } = await execa("node", [runAndKillPrompt], {
8283
cwd: resolve(__dirname),
8384
reject: false,
8485
maxBuffer: Infinity,
85-
killSignal: "SIGINT",
8686
});
8787

88-
expect(exitCode).toBe(0);
88+
if (isWindows) {
89+
expect(exitCode).toBe(1);
90+
} else {
91+
expect(exitCode).toBe(0);
92+
}
8993
expect(stderr).toContain("[webpack-cli] Operation canceled.");
9094
expect(stdout).toContain("Would you like to install package 'test'? (Yes/No):");
9195
});

0 commit comments

Comments
 (0)