Skip to content

Commit a900fa4

Browse files
committed
Fix e2e tests
- Due to changes in #567 e2e tests started to fail as args where passed with spaces instead of args array. - Fix all args use so that spawn underneath uses plain array with proper args.
1 parent a6b8437 commit a900fa4

6 files changed

+28
-28
lines changed

e2e/spring-shell-e2e-tests/test/builtin.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('builtin commands', () => {
3636
* test for command help command returns expected info
3737
*/
3838
const commandHelpReturnsInfoDesc = 'command help returns info';
39-
const commandHelpCommand = ['help help'];
39+
const commandHelpCommand = ['help', 'help'];
4040
const commandHelpReturnsInfo = async (cli: Cli) => {
4141
cli.run();
4242
await waitForExpect(async () => {

e2e/spring-shell-e2e-tests/test/sample-e2e-boolean-arity1-default-true.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe('e2e commands boolean-arity1-default-true', () => {
2121
* testBooleanArity1DefaultTrue
2222
*/
2323
const annoDefaultWithoutOverwriteReturnsTrueDesc = 'default without overwrite returns true (anno)';
24-
const annoDefaultWithoutOverwriteCommand = ['e2e anno boolean-arity1-default-true'];
24+
const annoDefaultWithoutOverwriteCommand = ['e2e', 'anno', 'boolean-arity1-default-true'];
2525
const annoDefaultWithoutOverwriteReturnsTrue = async (cli: Cli) => {
2626
cli.run();
2727
await waitForExpect(async () => {
@@ -35,7 +35,7 @@ describe('e2e commands boolean-arity1-default-true', () => {
3535
* testBooleanArity1DefaultTrueRegistration
3636
*/
3737
const regDefaultWithoutOverwriteReturnsTrueDesc = 'default without overwrite returns true (reg)';
38-
const regDefaultWithoutOverwriteCommand = ['e2e reg boolean-arity1-default-true'];
38+
const regDefaultWithoutOverwriteCommand = ['e2e', 'reg', 'boolean-arity1-default-true'];
3939
const regOptionalWithoutOverwriteReturnsTrue = async (cli: Cli) => {
4040
cli.run();
4141
await waitForExpect(async () => {
@@ -49,7 +49,7 @@ describe('e2e commands boolean-arity1-default-true', () => {
4949
* testBooleanArity1DefaultTrue
5050
*/
5151
const annoDefaultWithOverwriteFalseReturnsFalseDesc = 'default with overwrite false returns false (anno)';
52-
const annoDefaultWithOverwriteFalseCommand = ['e2e anno boolean-arity1-default-true --overwrite false'];
52+
const annoDefaultWithOverwriteFalseCommand = ['e2e', 'anno', 'boolean-arity1-default-true', '--overwrite', 'false'];
5353
const annoDefaultWithOverwriteFalseReturnsFalse = async (cli: Cli) => {
5454
cli.run();
5555
await waitForExpect(async () => {
@@ -63,7 +63,7 @@ describe('e2e commands boolean-arity1-default-true', () => {
6363
* testBooleanArity1DefaultTrueRegistration
6464
*/
6565
const regDefaultWithOverwriteFalseReturnsFalseDesc = 'default with overwrite false returns false (reg)';
66-
const regDefaultWithOverwriteFalseCommand = ['e2e reg boolean-arity1-default-true --overwrite false'];
66+
const regDefaultWithOverwriteFalseCommand = ['e2e', 'reg', 'boolean-arity1-default-true', '--overwrite', 'false'];
6767
const regOptionalWithOverwriteFalseReturnsFalse = async (cli: Cli) => {
6868
cli.run();
6969
await waitForExpect(async () => {

e2e/spring-shell-e2e-tests/test/sample-e2e-default-value.test.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('e2e commands default-value', () => {
2222
* testDefaultValue
2323
*/
2424
const annoDefaultWithoutArgReturnsHiDesc = 'default without arg returns hi (anno)';
25-
const annoDefaultWithoutArgCommand = ['e2e anno default-value'];
25+
const annoDefaultWithoutArgCommand = ['e2e', 'anno', 'default-value'];
2626
const annoDefaultWithoutArgReturnsHi = async (cli: Cli) => {
2727
cli.run();
2828
await waitForExpect(async () => {
@@ -36,7 +36,7 @@ describe('e2e commands default-value', () => {
3636
* testDefaultValueRegistration
3737
*/
3838
const regDefaultWithoutArgReturnsHiDesc = 'default without arg returns hi (reg)';
39-
const regDefaultWithoutArgCommand = ['e2e reg default-value'];
39+
const regDefaultWithoutArgCommand = ['e2e', 'reg', 'default-value'];
4040
const regOptionalWithoutArgReturnsHi = async (cli: Cli) => {
4141
cli.run();
4242
await waitForExpect(async () => {
@@ -50,7 +50,7 @@ describe('e2e commands default-value', () => {
5050
* testDefaultValue
5151
*/
5252
const annoDefaultWithArgReturnsFooDesc = 'default with arg returns foo (anno)';
53-
const annoDefaultWithArgCommand = ['e2e anno default-value --arg1 foo'];
53+
const annoDefaultWithArgCommand = ['e2e', 'anno', 'default-value', '--arg1', 'foo'];
5454
const annoDefaultWithArgReturnsFoo = async (cli: Cli) => {
5555
cli.run();
5656
await waitForExpect(async () => {
@@ -64,7 +64,7 @@ describe('e2e commands default-value', () => {
6464
* testDefaultValueRegistration
6565
*/
6666
const regDefaultWithArgReturnsFooDesc = 'default with arg returns foo (reg)';
67-
const regDefaultWithArgCommand = ['e2e reg optional-value --arg1 foo'];
67+
const regDefaultWithArgCommand = ['e2e', 'reg', 'optional-value', '--arg1', 'foo'];
6868
const regDefaultWithArgReturnsFoo = async (cli: Cli) => {
6969
cli.run();
7070
await waitForExpect(async () => {
@@ -78,7 +78,7 @@ describe('e2e commands default-value', () => {
7878
* testDefaultValueBoolean1 - 1
7979
*/
8080
const annoDefaultValueBoolean1WithoutArgReturnsFalseDesc = 'default boolean1 without arg returns false (anno)';
81-
const annoDefaultValueBoolean1WithoutArgCommand = ['e2e anno default-value-boolean1'];
81+
const annoDefaultValueBoolean1WithoutArgCommand = ['e2e', 'anno', 'default-value-boolean1'];
8282
const annoDefaultValueBoolean1WithoutArgReturnsFalse = async (cli: Cli) => {
8383
cli.run();
8484
await waitForExpect(async () => {
@@ -92,7 +92,7 @@ describe('e2e commands default-value', () => {
9292
* testDefaultValueBoolean1Registration - 1
9393
*/
9494
const regDefaultValueBoolean1WithoutArgReturnsFalseDesc = 'default boolean1 without arg returns false (reg)';
95-
const regDefaultValueBoolean1WithoutArgCommand = ['e2e reg default-value-boolean1'];
95+
const regDefaultValueBoolean1WithoutArgCommand = ['e2e', 'reg', 'default-value-boolean1'];
9696
const regDefaultValueBoolean1WithoutArgReturnsFalse = async (cli: Cli) => {
9797
cli.run();
9898
await waitForExpect(async () => {
@@ -106,7 +106,7 @@ describe('e2e commands default-value', () => {
106106
* testDefaultValueBoolean1 - 2
107107
*/
108108
const annoDefaultValueBoolean2WithArgReturnsTrueDesc = 'default boolean1 with arg returns true (anno)';
109-
const annoDefaultValueBoolean2WithArgCommand = ['e2e anno default-value-boolean1 --arg1'];
109+
const annoDefaultValueBoolean2WithArgCommand = ['e2e', 'anno', 'default-value-boolean1', '--arg1'];
110110
const annoDefaultValueBoolean2WithArgReturnsTrue = async (cli: Cli) => {
111111
cli.run();
112112
await waitForExpect(async () => {
@@ -120,7 +120,7 @@ describe('e2e commands default-value', () => {
120120
* testDefaultValueBoolean1Registration - 2
121121
*/
122122
const regDefaultValueBoolean2WithArgReturnsTrueDesc = 'default boolean1 with arg returns true (reg)';
123-
const regDefaultValueBoolean2WithArgCommand = ['e2e reg default-value-boolean1 --arg1'];
123+
const regDefaultValueBoolean2WithArgCommand = ['e2e', 'reg', 'default-value-boolean1', '--arg1'];
124124
const regDefaultValueBoolean2WithArgReturnsTrue = async (cli: Cli) => {
125125
cli.run();
126126
await waitForExpect(async () => {
@@ -134,7 +134,7 @@ describe('e2e commands default-value', () => {
134134
* testDefaultValueBoolean1 - 3
135135
*/
136136
const annoDefaultValueBoolean3WithArgReturnsFalseDesc = 'default boolean1 with arg returns false (anno)';
137-
const annoDefaultValueBoolean3WithArgCommand = ['e2e anno default-value-boolean1 --arg1 false'];
137+
const annoDefaultValueBoolean3WithArgCommand = ['e2e', 'anno', 'default-value-boolean1', '--arg1', 'false'];
138138
const annoDefaultValueBoolean3WithArgReturnsFalse = async (cli: Cli) => {
139139
cli.run();
140140
await waitForExpect(async () => {
@@ -148,7 +148,7 @@ describe('e2e commands default-value', () => {
148148
* testDefaultValueBoolean1Registration - 3
149149
*/
150150
const regDefaultValueBoolean3WithArgReturnsFalseDesc = 'default boolean1 with arg returns false (reg)';
151-
const regDefaultValueBoolean3WithArgCommand = ['e2e reg default-value-boolean1 --arg1 false'];
151+
const regDefaultValueBoolean3WithArgCommand = ['e2e', 'reg', 'default-value-boolean1', '--arg1', 'false'];
152152
const regDefaultValueBoolean3WithArgReturnsFalse = async (cli: Cli) => {
153153
cli.run();
154154
await waitForExpect(async () => {
@@ -162,7 +162,7 @@ describe('e2e commands default-value', () => {
162162
* testDefaultValueBoolean2 - 1
163163
*/
164164
const annoDefaultValueBoolean2WithoutArgReturnsTrueDesc = 'default boolean2 without arg returns true (anno)';
165-
const annoDefaultValueBoolean2WithoutArgCommand = ['e2e anno default-value-boolean2'];
165+
const annoDefaultValueBoolean2WithoutArgCommand = ['e2e', 'anno', 'default-value-boolean2'];
166166
const annoDefaultValueBoolean2WithoutArgReturnsTrue = async (cli: Cli) => {
167167
cli.run();
168168
await waitForExpect(async () => {
@@ -176,7 +176,7 @@ describe('e2e commands default-value', () => {
176176
* testDefaultValueBoolean2Registration - 1
177177
*/
178178
const regDefaultValueBoolean2WithoutArgReturnsTrueDesc = 'default boolean2 without arg returns true (reg)';
179-
const regDefaultValueBoolean2WithoutArgCommand = ['e2e reg default-value-boolean2'];
179+
const regDefaultValueBoolean2WithoutArgCommand = ['e2e', 'reg', 'default-value-boolean2'];
180180
const regDefaultValueBoolean2WithoutArgReturnsTrue = async (cli: Cli) => {
181181
cli.run();
182182
await waitForExpect(async () => {
@@ -190,7 +190,7 @@ describe('e2e commands default-value', () => {
190190
* testDefaultValueBoolean3 - 1
191191
*/
192192
const annoDefaultValueBoolean3WithoutArgReturnsFalseDesc = 'default boolean3 without arg returns false (anno)';
193-
const annoDefaultValueBoolean3WithoutArgCommand = ['e2e anno default-value-boolean3'];
193+
const annoDefaultValueBoolean3WithoutArgCommand = ['e2e', 'anno', 'default-value-boolean3'];
194194
const annoDefaultValueBoolean3WithoutArgReturnsFalse = async (cli: Cli) => {
195195
cli.run();
196196
await waitForExpect(async () => {
@@ -204,7 +204,7 @@ describe('e2e commands default-value', () => {
204204
* testDefaultValueBoolean3Registration - 1
205205
*/
206206
const regDefaultValueBoolean3WithoutArgReturnsFalseDesc = 'default boolean3 without arg returns false (reg)';
207-
const regDefaultValueBoolean3WithoutArgCommand = ['e2e reg default-value-boolean3'];
207+
const regDefaultValueBoolean3WithoutArgCommand = ['e2e', 'reg', 'default-value-boolean3'];
208208
const regDefaultValueBoolean3WithoutArgReturnsFalse = async (cli: Cli) => {
209209
cli.run();
210210
await waitForExpect(async () => {

e2e/spring-shell-e2e-tests/test/sample-e2e-exit-code.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('e2e commands exit-code', () => {
1818
let options: string[] = [];
1919

2020
const missingArgRet2Desc = 'missing arg returns 2';
21-
const missingArgRet2Command = ['e2e reg exit-code'];
21+
const missingArgRet2Command = ['e2e', 'reg', 'exit-code'];
2222
const missingArgRet2 = async (cli: Cli) => {
2323
cli.run();
2424
await waitForExpect(async () => {
@@ -29,7 +29,7 @@ describe('e2e commands exit-code', () => {
2929
};
3030

3131
const customArgRet3Desc = 'custom arg returns 3';
32-
const customArgRet3Command = ['e2e reg exit-code --arg1 ok'];
32+
const customArgRet3Command = ['e2e', 'reg', 'exit-code', '--arg1', 'ok'];
3333
const customArgRet3 = async (cli: Cli) => {
3434
cli.run();
3535
await waitForExpect(async () => {
@@ -40,7 +40,7 @@ describe('e2e commands exit-code', () => {
4040
};
4141

4242
const customArgRet4Desc = 'custom arg returns 4';
43-
const customArgRet4Command = ['e2e reg exit-code --arg1 fun'];
43+
const customArgRet4Command = ['e2e', 'reg', 'exit-code', '--arg1', 'fun'];
4444
const customArgRet4 = async (cli: Cli) => {
4545
cli.run();
4646
await waitForExpect(async () => {

e2e/spring-shell-e2e-tests/test/sample-e2e-optional-value.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('e2e commands optional-value', () => {
2222
* testOptionalValue
2323
*/
2424
const annoOptionalWithoutArgReturnsNullDesc = 'optional without arg returns null (anno)';
25-
const annoOptionalWithoutArgCommand = ['e2e anno optional-value'];
25+
const annoOptionalWithoutArgCommand = ['e2e', 'anno', 'optional-value'];
2626
const annoOptionalWithoutArgReturnsNull = async (cli: Cli) => {
2727
cli.run();
2828
await waitForExpect(async () => {
@@ -36,7 +36,7 @@ describe('e2e commands optional-value', () => {
3636
* testOptionalValueRegistration
3737
*/
3838
const regOptionalWithoutArgReturnsNullDesc = 'optional without arg returns null (reg)';
39-
const regOptionalWithoutArgCommand = ['e2e reg optional-value'];
39+
const regOptionalWithoutArgCommand = ['e2e', 'reg', 'optional-value'];
4040
const regOptionalWithoutArgReturnsNull = async (cli: Cli) => {
4141
cli.run();
4242
await waitForExpect(async () => {
@@ -50,7 +50,7 @@ describe('e2e commands optional-value', () => {
5050
* testOptionalValue
5151
*/
5252
const annoOptionalWithArgReturnsNullDesc = 'optional with arg returns hi (anno)';
53-
const annoOptionalWithArgCommand = ['e2e anno optional-value --arg1 hi'];
53+
const annoOptionalWithArgCommand = ['e2e', 'anno', 'optional-value', '--arg1', 'hi'];
5454
const annoOptionalWithArgReturnsNull = async (cli: Cli) => {
5555
cli.run();
5656
await waitForExpect(async () => {
@@ -64,7 +64,7 @@ describe('e2e commands optional-value', () => {
6464
* testOptionalValueRegistration
6565
*/
6666
const regOptionalWithArgReturnsHiDesc = 'optional with arg returns hi (reg)';
67-
const regOptionalWithArgCommand = ['e2e reg optional-value --arg1 hi'];
67+
const regOptionalWithArgCommand = ['e2e', 'reg', 'optional-value', '--arg1', 'hi'];
6868
const regOptionalWithArgReturnsHi = async (cli: Cli) => {
6969
cli.run();
7070
await waitForExpect(async () => {

e2e/spring-shell-e2e-tests/test/sample-e2e-required-value.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('e2e commands required-value', () => {
1818
let options: string[] = [];
1919

2020
const annoRequiredWithoutArgReturnsErrorDesc = 'required without arg returns error (anno)';
21-
const annoRequiredWithoutArgCommand = ['e2e anno required-value'];
21+
const annoRequiredWithoutArgCommand = ['e2e', 'anno', 'required-value'];
2222
const annoRequiredWithoutArgReturnsError = async (cli: Cli) => {
2323
cli.run();
2424
await waitForExpect(async () => {
@@ -29,7 +29,7 @@ describe('e2e commands required-value', () => {
2929
};
3030

3131
const regRequiredWithoutArgReturnsErrorDesc = 'required without arg returns error (reg)';
32-
const regRequiredWithoutArgCommand = ['e2e reg required-value'];
32+
const regRequiredWithoutArgCommand = ['e2e', 'reg', 'required-value'];
3333
const regRequiredWithoutArgReturnsError = async (cli: Cli) => {
3434
cli.run();
3535
await waitForExpect(async () => {

0 commit comments

Comments
 (0)