Skip to content

Commit 3715473

Browse files
committed
chore: update default answers, remove too detailed unit tests
1 parent 6b28859 commit 3715473

12 files changed

+28
-560
lines changed

__test__/after-task.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ test('"after" task only prints summary in unattended mode and here mode', async
8282
test('"after" task installs deps with npm, and prints summary', async t => {
8383
const prompts = {
8484
select(opts) {
85-
t.deepEqual(opts.choices.map(c => c.value), [undefined, 'npm', 'yarn', 'pnpm']);
85+
t.deepEqual(opts.choices.map(c => c.value), ['npm', 'yarn', 'pnpm', undefined]);
8686
return 'npm';
8787
}
8888
};
@@ -121,7 +121,7 @@ test('"after" task installs deps with npm, and prints summary', async t => {
121121
test('"after" task installs deps with yarn, and prints summary', async t => {
122122
const prompts = {
123123
select(opts) {
124-
t.deepEqual(opts.choices.map(c => c.value), [undefined, 'npm', 'yarn', 'pnpm']);
124+
t.deepEqual(opts.choices.map(c => c.value), ['npm', 'yarn', 'pnpm', undefined]);
125125
return 'yarn';
126126
}
127127
};
@@ -160,7 +160,7 @@ test('"after" task installs deps with yarn, and prints summary', async t => {
160160
test('"after" task installs deps with pnpm, and prints summary', async t => {
161161
const prompts = {
162162
select(opts) {
163-
t.deepEqual(opts.choices.map(c => c.value), [undefined, 'npm', 'yarn', 'pnpm']);
163+
t.deepEqual(opts.choices.map(c => c.value), ['npm', 'yarn', 'pnpm', undefined]);
164164
return 'pnpm';
165165
}
166166
};
@@ -199,7 +199,7 @@ test('"after" task installs deps with pnpm, and prints summary', async t => {
199199
test('"after" task installs deps, and prints summary in here mode', async t => {
200200
const prompts = {
201201
select(opts) {
202-
t.deepEqual(opts.choices.map(c => c.value), [undefined, 'npm']);
202+
t.deepEqual(opts.choices.map(c => c.value), ['npm', undefined]);
203203
return 'npm';
204204
}
205205
};

__test__/questions.spec.js

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -5,90 +5,3 @@ const questions = require('../questions');
55
test('questions array can be loaded', t => {
66
t.true(Array.isArray(questions));
77
});
8-
9-
test('TailwindCSS question is properly included', t => {
10-
const tailwindQuestion = questions.find(q =>
11-
q.message && q.message.includes('TailwindCSS')
12-
);
13-
14-
t.truthy(tailwindQuestion, 'TailwindCSS question should exist');
15-
t.is(tailwindQuestion.message, 'Do you want to use TailwindCSS?');
16-
t.true(Array.isArray(tailwindQuestion.choices), 'TailwindCSS question should have choices');
17-
t.is(tailwindQuestion.choices.length, 2, 'TailwindCSS question should have 2 choices');
18-
19-
// Check "No" option
20-
const noChoice = tailwindQuestion.choices[0];
21-
t.is(noChoice.title, 'No');
22-
t.is(noChoice.value, undefined);
23-
24-
// Check "Yes" option
25-
const yesChoice = tailwindQuestion.choices[1];
26-
t.is(yesChoice.value, 'tailwindcss');
27-
t.is(yesChoice.title, 'Yes');
28-
t.truthy(yesChoice.hint);
29-
t.true(yesChoice.hint.includes('utility-first'));
30-
});
31-
32-
test('TailwindCSS question comes after CSS preprocessor question', t => {
33-
const cssQuestionIndex = questions.findIndex(q =>
34-
q.message && q.message.includes('CSS preprocessor')
35-
);
36-
const tailwindQuestionIndex = questions.findIndex(q =>
37-
q.message && q.message.includes('TailwindCSS')
38-
);
39-
40-
t.true(cssQuestionIndex >= 0, 'CSS preprocessor question should exist');
41-
t.true(tailwindQuestionIndex >= 0, 'TailwindCSS question should exist');
42-
t.true(tailwindQuestionIndex > cssQuestionIndex, 'TailwindCSS question should come after CSS preprocessor question');
43-
});
44-
45-
test('TailwindCSS question comes before unit testing question', t => {
46-
const tailwindQuestionIndex = questions.findIndex(q =>
47-
q.message && q.message.includes('TailwindCSS')
48-
);
49-
const testingQuestionIndex = questions.findIndex(q =>
50-
q.message && q.message.includes('unit testing')
51-
);
52-
53-
t.true(tailwindQuestionIndex >= 0, 'TailwindCSS question should exist');
54-
t.true(testingQuestionIndex >= 0, 'Unit testing question should exist');
55-
t.true(tailwindQuestionIndex < testingQuestionIndex, 'TailwindCSS question should come before unit testing question');
56-
});
57-
58-
test('Storybook question is properly included', t => {
59-
const storybookQuestion = questions.find(q =>
60-
q.message && q.message.includes('Storybook')
61-
);
62-
63-
t.truthy(storybookQuestion, 'Storybook question should exist');
64-
t.is(storybookQuestion.message, 'Do you want to add Storybook?');
65-
t.true(Array.isArray(storybookQuestion.choices), 'Storybook question should have choices');
66-
t.is(storybookQuestion.choices.length, 2, 'Storybook question should have 2 choices');
67-
68-
// Check "No" option
69-
const noChoice = storybookQuestion.choices[0];
70-
t.is(noChoice.title, 'No');
71-
t.is(noChoice.value, undefined);
72-
73-
// Check "Yes" option
74-
const yesChoice = storybookQuestion.choices[1];
75-
t.is(yesChoice.value, 'storybook');
76-
t.is(yesChoice.title, 'Yes');
77-
t.truthy(yesChoice.hint);
78-
t.true(yesChoice.hint.includes('Vite or Webpack'));
79-
t.truthy(yesChoice.if);
80-
t.is(yesChoice.if, '(app && (vite || webpack)) || (plugin && webpack)');
81-
});
82-
83-
test('Storybook question comes after e2e testing question', t => {
84-
const e2eQuestionIndex = questions.findIndex(q =>
85-
q.message && q.message.includes('e2e test')
86-
);
87-
const storybookQuestionIndex = questions.findIndex(q =>
88-
q.message && q.message.includes('Storybook')
89-
);
90-
91-
t.true(e2eQuestionIndex >= 0, 'E2E testing question should exist');
92-
t.true(storybookQuestionIndex >= 0, 'Storybook question should exist');
93-
t.true(storybookQuestionIndex > e2eQuestionIndex, 'Storybook question should come after e2e testing question');
94-
});

__test__/storybook.spec.js

Lines changed: 0 additions & 119 deletions
This file was deleted.

0 commit comments

Comments
 (0)