Skip to content

Commit be27901

Browse files
committed
changing flags for testing
1 parent a120235 commit be27901

2 files changed

Lines changed: 73 additions & 64 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Tutorials for catalog on sap.com http://go.sap.com/developer/tutorials.html",
55
"main": "README.MD",
66
"scripts": {
7-
"test": "node test.js -pa"
7+
"test": "node test.js -pt"
88
},
99
"repository": {
1010
"type": "git",
@@ -30,4 +30,4 @@
3030
"progress": "^1.1.8",
3131
"recursive-readdir": "^2.0.0"
3232
}
33-
}
33+
}

test.js

Lines changed: 71 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -41,87 +41,96 @@ if (options.file){
4141
inquirerprompt.setShowfilename(true);
4242
}
4343

44-
//if p flag is set it turns off the progressbar
45-
if (options.progressbar){
46-
inquirerprompt.turnoffprogressbar(true);
44+
if (options.all || options.wip || options.input || options.specific){
45+
console.log("There is no work-in-progress folder and no further selection. Please use -t");
4746
}
47+
else{
4848

49-
if (options.help){
50-
log.info("HELP: Your possibilities for the input: \n -h or --help for Help \n -f: to log all filenames, which get tested \n -a: for testing everything (including files, which aren't tutorials) \n -w & -t: for testing every tutorial in both folders \n -w: for testing all files in the work-in-progress folder \n -t: for testing all files in the tutorials folder \n -s: for dialog to choose specific tutorials \n -i: to give an filename behind with *\n to resctrict the scope: enter -w or/and -t \n -p: to turn off the progressbar ");
51-
}
49+
//if p flag is set it turns off the progressbar
50+
if (options.progressbar){
51+
inquirerprompt.turnoffprogressbar(true);
52+
}
5253

53-
else if (options.all){
54-
//input flag a
55-
inquirerprompt.readtutorialnames(function (){
56-
inquirerprompt.readwipnames(function () {
57-
inquirerprompt.readallfilenames(function () {
58-
inquirerprompt.allfiles();
54+
if (options.help){
55+
log.info("HELP: Your possibilities for the input: \n -h or --help for Help \n -f: to log all filenames, which get tested \n -t: for testing all files in the tutorials folder \n -p: to turn off the progressbar ");
56+
}
57+
58+
else if (options.all){
59+
//input flag a
60+
inquirerprompt.readtutorialnames(function (){
61+
inquirerprompt.readwipnames(function () {
62+
inquirerprompt.readallfilenames(function () {
63+
inquirerprompt.allfiles();
64+
});
5965
});
6066
});
61-
});
62-
}
67+
}
6368

64-
else if (options.tutorials && options.wip && !options.input){
65-
//input flag w and t
66-
inquirerprompt.readtutorialnames(function (){
67-
inquirerprompt.readwipnames(function () {
68-
inquirerprompt.alltutorials();
69+
else if (options.tutorials && options.wip && !options.input){
70+
//input flag w and t
71+
inquirerprompt.readtutorialnames(function (){
72+
inquirerprompt.readwipnames(function () {
73+
inquirerprompt.alltutorials();
74+
});
6975
});
70-
});
71-
}
72-
73-
else if (options.tutorials && !options.wip && !options.input){
74-
//input flag t
75-
inquirerprompt.readtutorialnames(function (){
76-
inquirerprompt.tutorials();
77-
});
78-
}
76+
}
7977

80-
else if (options.wip && !options.tutorials && !options.input){
81-
//input flag w
82-
inquirerprompt.readwipnames(function () {
83-
inquirerprompt.wip();
84-
});
85-
}
78+
else if (options.tutorials && !options.wip && !options.input){
79+
//input flag t
80+
inquirerprompt.readtutorialnames(function (){
81+
inquirerprompt.tutorials();
82+
});
83+
}
8684

87-
else if (options.specific){
88-
//input flag s
89-
inquirerprompt.readtutorialnames(function (){
85+
else if (options.wip && !options.tutorials && !options.input){
86+
//input flag w
9087
inquirerprompt.readwipnames(function () {
91-
inquirerprompt.specific();
88+
inquirerprompt.wip();
9289
});
93-
});
94-
}
90+
}
9591

96-
else if (options.input){
97-
//only input or wt and input
98-
if ((options.tutorials && options.wip) || (!options.tutorials && !options.wip)){
92+
else if (options.specific){
93+
//input flag s
9994
inquirerprompt.readtutorialnames(function (){
10095
inquirerprompt.readwipnames(function () {
101-
inquirerprompt.allgrouptutorials(options.input);
96+
inquirerprompt.specific();
10297
});
10398
});
10499
}
105100

106-
//w and input
107-
else if (options.wip){
108-
inquirerprompt.readwipnames(function () {
109-
inquirerprompt.wipgrouptutorials(options.input);
110-
});
111-
}
112-
//t and input
113-
else if (options.tutorials){
114-
inquirerprompt.readtutorialnames(function (){
115-
inquirerprompt.tutorialsgrouptutorials(options.input);
116-
});
101+
else if (options.input){
102+
//only input or wt and input
103+
if ((options.tutorials && options.wip) || (!options.tutorials && !options.wip)){
104+
inquirerprompt.readtutorialnames(function (){
105+
inquirerprompt.readwipnames(function () {
106+
inquirerprompt.allgrouptutorials(options.input);
107+
});
108+
});
109+
}
110+
111+
//w and input
112+
else if (options.wip){
113+
inquirerprompt.readwipnames(function () {
114+
inquirerprompt.wipgrouptutorials(options.input);
115+
});
116+
}
117+
//t and input
118+
else if (options.tutorials){
119+
inquirerprompt.readtutorialnames(function (){
120+
inquirerprompt.tutorialsgrouptutorials(options.input);
121+
});
122+
}
117123
}
118-
}
119124

120-
else {
121-
// (no user input parameters (except of f))
122-
if (!options.tutorials && !options.wip && !options.all && !options.help && !options.specific && !options.input)
123-
inquirerprompt.ask(arraydeclaration.choicearray);
124-
else{
125-
log.error("Error: no available command identified )\n prompt --help or -h for more info");
125+
else {
126+
// (no user input parameters (except of f))
127+
if (!options.tutorials && !options.wip && !options.all && !options.help && !options.specific && !options.input)
128+
inquirerprompt.readtutorialnames(function (){
129+
inquirerprompt.tutorials();
130+
});
131+
//inquirerprompt.ask(arraydeclaration.choicearray);
132+
else{
133+
log.error("Error: no available command identified )\n prompt --help or -h for more info");
134+
}
126135
}
127136
}

0 commit comments

Comments
 (0)