Skip to content

Commit

Permalink
test(unit): add unit tests for docker feature selection
Browse files Browse the repository at this point in the history
  • Loading branch information
shahabganji authored and 3cp committed Sep 12, 2019
1 parent 2a42ded commit 9419bc4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
8 changes: 3 additions & 5 deletions lib/workflow/questionnaire.js
Expand Up @@ -12,12 +12,10 @@ exports.pickPlugin = {
exports.askDocker = {
message: 'Do you like to add a Dockerfile?',
choices: [{
value: 'docker', message: 'Sure, yes'
},
{
value: 'none', message: 'No'
}
]
}, {
value: 'docker', message: 'Sure, yes'
}]
};

exports.askBundler = {
Expand Down
18 changes: 12 additions & 6 deletions spec/lib/workflow/select-features.spec.js
Expand Up @@ -87,7 +87,8 @@ describe('The selectFeatures for app project', () => {
2, // karma
3, // cypress
1, // no editor
2 // scaffold-navigation
2, // scaffold-navigation
1 // no docker file
]);

expect(result).toEqual([
Expand Down Expand Up @@ -117,7 +118,8 @@ describe('The selectFeatures for app project', () => {
1, // no unit test
2, // protractor
1, // no editor
1 // scaffold-minimum
1, // scaffold-minimum
2 // docker file
]);

expect(result).toEqual([
Expand All @@ -128,7 +130,8 @@ describe('The selectFeatures for app project', () => {
'less',
'postcss-basic',
'protractor',
'scaffold-minimum'
'scaffold-minimum',
'docker'
]);
});

Expand All @@ -145,7 +148,8 @@ describe('The selectFeatures for app project', () => {
1, // no unit test
1, // no e2e test
1, // no editor
1 // scaffold-minimum
1, // scaffold-minimum
1 // no docker file
]);

expect(result).toEqual(['webpack', 'http1', 'web', 'babel', 'scaffold-minimum']);
Expand All @@ -159,7 +163,8 @@ describe('The selectFeatures for app project', () => {
2, // htmlmin-min
3, // postcss-typical
2, // vscode
2 // scaffold-navigation
2, // scaffold-navigation
2 // docker
]);

expect(result).toEqual([
Expand All @@ -173,7 +178,8 @@ describe('The selectFeatures for app project', () => {
'karma',
'cypress',
'vscode',
'scaffold-navigation'
'scaffold-navigation',
'docker'
]);
});
});
Expand Down

0 comments on commit 9419bc4

Please sign in to comment.