-
Notifications
You must be signed in to change notification settings - Fork 556
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1327 from snyk/feat/smoke-test
chore(test): add regression test for valid JSON bodies
- Loading branch information
Showing
6 changed files
with
130 additions
and
12 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
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#shellcheck shell=sh | ||
|
||
: ' | ||
Since we are dealing with multiple utilities and environments | ||
we should have a sanity test in place to test them | ||
' | ||
|
||
Describe "Snyk CLI" | ||
It "have Snyk CLI available" | ||
When run which snyk | ||
The output should include "/snyk" | ||
The status should be success | ||
The stderr should equal "" | ||
End | ||
End | ||
|
||
Describe "sanity checks for tooling" | ||
Describe "timeout" | ||
It "have timeout available" | ||
When run which timeout | ||
The output should include "/timeout" | ||
The status should be success | ||
The stderr should equal "" | ||
End | ||
End | ||
|
||
Describe "jq" | ||
It "have jq available" | ||
When run which jq | ||
The output should include "/jq" | ||
The status should be success | ||
The stderr should equal "" | ||
End | ||
|
||
It "validates JSON" | ||
When run echo '{"k": [1,2]}' | ||
The result of function check_valid_json should be success | ||
End | ||
|
||
It "validates JSON when called as When-function" | ||
When run check_valid_json '{"k": [1,2]}' | ||
The status should be success | ||
The stdout should equal 0 | ||
The stderr should equal "" | ||
End | ||
|
||
# Only way to capture parse error | ||
It "fails on invalid JSON" | ||
When run check_valid_json '{"k": [1,2' | ||
The status should be failure | ||
The stderr should include "parse error" | ||
End | ||
End | ||
End |
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