Skip to content

Commit b4ef065

Browse files
test: update test suite
1 parent f473db5 commit b4ef065

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

packages/generators/src/init-generator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export default class InitGenerator extends CustomGenerator {
108108
"Pick a package manager:",
109109
this.utils.getAvailableInstallers(),
110110
defaultPackager,
111-
false,
111+
this.force,
112112
);
113113
const opts: {
114114
dev?: boolean;

test/init/init.test.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ describe("init command", () => {
144144
const { stdout, stderr } = await runPromptWithAnswers(
145145
assetsPath,
146146
["init"],
147-
[`${DOWN}${DOWN}${ENTER}`, `n${ENTER}`, `n${ENTER}`, `n${ENTER}`, ENTER],
147+
[`${DOWN}${DOWN}${ENTER}`, `n${ENTER}`, `n${ENTER}`, `n${ENTER}`, ENTER, ENTER],
148148
);
149149

150150
expect(stdout).toContain("Project has been initialised with webpack!");
@@ -170,7 +170,7 @@ describe("init command", () => {
170170
const { stdout, stderr } = await runPromptWithAnswers(
171171
assetsPath,
172172
["init"],
173-
[`${DOWN}${ENTER}`, `n${ENTER}`, `n${ENTER}`, `n${ENTER}`, ENTER],
173+
[`${DOWN}${ENTER}`, `n${ENTER}`, `n${ENTER}`, `n${ENTER}`, ENTER, ENTER],
174174
);
175175

176176
expect(stdout).toContain("Project has been initialised with webpack!");
@@ -205,6 +205,7 @@ describe("init command", () => {
205205
`n${ENTER}`,
206206
`n${ENTER}`,
207207
`n${ENTER}`,
208+
ENTER,
208209
],
209210
);
210211

@@ -239,6 +240,7 @@ describe("init command", () => {
239240
`n${ENTER}`,
240241
`y${ENTER}`,
241242
`n${ENTER}`,
243+
ENTER,
242244
],
243245
);
244246

@@ -279,6 +281,7 @@ describe("init command", () => {
279281
`n${ENTER}`,
280282
`n${ENTER}`,
281283
`y${ENTER}`,
284+
ENTER,
282285
],
283286
);
284287

@@ -313,6 +316,7 @@ describe("init command", () => {
313316
`y${ENTER}`,
314317
`y${ENTER}`,
315318
`n${ENTER}`,
319+
ENTER,
316320
],
317321
);
318322

@@ -353,6 +357,7 @@ describe("init command", () => {
353357
`n${ENTER}`,
354358
`n${ENTER}`,
355359
`n${ENTER}`,
360+
ENTER,
356361
],
357362
);
358363

@@ -387,6 +392,7 @@ describe("init command", () => {
387392
`n${ENTER}`,
388393
`n${ENTER}`,
389394
`n${ENTER}`,
395+
ENTER,
390396
],
391397
);
392398

@@ -412,7 +418,7 @@ describe("init command", () => {
412418
const { stdout, stderr } = await runPromptWithAnswers(
413419
assetsPath,
414420
["init"],
415-
[ENTER, ENTER, `n${ENTER}`, `n${ENTER}`, ENTER],
421+
[ENTER, ENTER, `n${ENTER}`, `n${ENTER}`, ENTER, ENTER],
416422
);
417423

418424
expect(stdout).toContain("Do you want to use webpack-dev-server?");
@@ -445,6 +451,7 @@ describe("init command", () => {
445451
`${DOWN}${ENTER}`,
446452
ENTER,
447453
`n${ENTER}`,
454+
ENTER,
448455
],
449456
);
450457

@@ -476,7 +483,7 @@ describe("init command", () => {
476483
const { stdout, stderr } = await runPromptWithAnswers(
477484
assetsPath,
478485
["init"],
479-
[ENTER, `n${ENTER}`, ENTER, `n${ENTER}`, ENTER],
486+
[ENTER, `n${ENTER}`, ENTER, `n${ENTER}`, ENTER, ENTER],
480487
);
481488

482489
expect(stdout).toContain(
@@ -504,7 +511,7 @@ describe("init command", () => {
504511
const { stdout, stderr } = await runPromptWithAnswers(
505512
assetsPath,
506513
["init"],
507-
[ENTER, `n${ENTER}`, ENTER, ENTER, ENTER],
514+
[ENTER, `n${ENTER}`, ENTER, ENTER, ENTER, ENTER],
508515
);
509516

510517
expect(stdout).toContain("Do you want to add PWA support?");

0 commit comments

Comments
 (0)