-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop script and throw error if used same cli parameter twice
- Loading branch information
1 parent
0018c9f
commit df9cbe7
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,5 +29,14 @@ describe('Exec Command With Bash', () => { | |
/verbose should be empty or one of \[info, log, warn, error, quiet\]/, | ||
) | ||
}) | ||
|
||
test('Exec Command With doubled options', async () => { | ||
await expect(execa(`${mwo} --verbose --mwUrl="https://en.wikipedia.org" --adminEmail="[email protected]" --verbose=info`, { shell: true })).rejects.toThrow( | ||
/Parameter verbose can't take value \"\[true,\"info\"\]\"/, | ||
) | ||
await expect(execa(`${mwo} --verbose --mwUrl="https://en.wikipedia.org" --adminEmail="[email protected]" --mwUrl="https://en.wikipedia.org"`, { shell: true })).rejects.toThrow( | ||
/Parameter mwUrl can't take value \"\[\"https:\/\/en.wikipedia.org\",\"https:\/\/en.wikipedia.org\"\]\"/, | ||
) | ||
}) | ||
}) | ||
}) |