Skip to content

Commit

Permalink
chore: add back option to skip unit testing
Browse files Browse the repository at this point in the history
closes #9
  • Loading branch information
3cp committed Sep 2, 2020
1 parent 0d5c9ba commit 35153b9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
12 changes: 6 additions & 6 deletions __test__/before-task.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ test.serial('"before" task can select default-esnext preset', async t => {
const result = await before({unattended: false, prompts});
t.deepEqual(result, {
silentQuestions: true,
preselectedFeatures: ['vscode']
preselectedFeatures: ['jest', 'vscode']
});
});

Expand All @@ -56,7 +56,7 @@ test.serial('"before" task can select default-typescript preset', async t => {
const result = await before({unattended: false, prompts});
t.deepEqual(result, {
silentQuestions: true,
preselectedFeatures: ['typescript', 'vscode']
preselectedFeatures: ['typescript', 'jest', 'vscode']
});
});

Expand All @@ -71,7 +71,7 @@ test.serial('"before" task can select default-esnext-plugin preset', async t =>
const result = await before({unattended: false, prompts});
t.deepEqual(result, {
silentQuestions: true,
preselectedFeatures: ['plugin', 'vscode']
preselectedFeatures: ['plugin', 'jest', 'vscode']
});
});

Expand All @@ -88,7 +88,7 @@ test.serial('"before" task can select default-typescript-plugin preset', async t
const result = await before({unattended: false, prompts});
t.deepEqual(result, {
silentQuestions: true,
preselectedFeatures: ['plugin', 'typescript', 'vscode']
preselectedFeatures: ['plugin', 'typescript', 'jest', 'vscode']
});
});

Expand Down Expand Up @@ -148,7 +148,7 @@ test.serial('"before" task can select default-esnext-plugin preset with --plugin
const result = await before({unattended: false, prompts});
t.deepEqual(result, {
silentQuestions: true,
preselectedFeatures: ['plugin', 'vscode']
preselectedFeatures: ['plugin', 'jest', 'vscode']
});

process.argv = oldArgv;
Expand All @@ -170,7 +170,7 @@ test.serial('"before" task can select default-typescript-plugin preset with --pl
const result = await before({unattended: false, prompts});
t.deepEqual(result, {
silentQuestions: true,
preselectedFeatures: ['plugin', 'typescript', 'vscode']
preselectedFeatures: ['plugin', 'typescript', 'jest', 'vscode']
});
process.argv = oldArgv;
});
Expand Down
8 changes: 4 additions & 4 deletions before.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Use "before" task to ask user to select a preset (to skip questionnaire).

const PRESETS = {
'default-esnext': [ 'vscode' ],
'default-typescript': ['typescript', 'vscode'],
'default-esnext-plugin': [ 'plugin', 'vscode' ],
'default-typescript-plugin': ['plugin', 'typescript', 'vscode'],
'default-esnext': [ 'jest', 'vscode' ],
'default-typescript': ['typescript', 'jest', 'vscode'],
'default-esnext-plugin': [ 'plugin', 'jest', 'vscode' ],
'default-typescript-plugin': ['plugin', 'typescript', 'jest', 'vscode'],
};

module.exports = async function({unattended, prompts, preselectedFeatures}) {
Expand Down
3 changes: 3 additions & 0 deletions questions.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ module.exports = [
{
message: 'Which unit test runner would you like to use?',
choices: [{
title: 'None',
hint: 'No unit testing'
}, {
value: 'jest',
title: 'Jest',
hint: 'Unit testing with Jest'
Expand Down

0 comments on commit 35153b9

Please sign in to comment.