|
| 1 | +#shellcheck shell=sh |
| 2 | + |
| 3 | +Describe "Snyk monitor command" |
| 4 | + Before snyk_login |
| 5 | + After snyk_logout |
| 6 | + |
| 7 | + Describe "monitor npm project" |
| 8 | + run_monitor_in_subfolder() { |
| 9 | + cd ../fixtures/basic-npm || return |
| 10 | + snyk monitor |
| 11 | + } |
| 12 | + |
| 13 | + It "monitors a project in the same folder" |
| 14 | + When run run_monitor_in_subfolder |
| 15 | + The status should be success |
| 16 | + The output should include "Explore this snapshot at https://app.snyk.io/org/" |
| 17 | + The output should include "Notifications about newly disclosed issues related to these dependencies will be emailed to you." |
| 18 | + The stderr should equal "" |
| 19 | + End |
| 20 | + |
| 21 | + It "monitors a project when pointing to a folder" |
| 22 | + When run snyk monitor ../fixtures/basic-npm |
| 23 | + The status should be success |
| 24 | + The output should include "Explore this snapshot at https://app.snyk.io/org/" |
| 25 | + The output should include "Notifications about newly disclosed issues related to these dependencies will be emailed to you." |
| 26 | + The stderr should equal "" |
| 27 | + End |
| 28 | + |
| 29 | + It "monitors a project when pointing to a file" |
| 30 | + When run snyk monitor --file=../fixtures/basic-npm/package.json |
| 31 | + The status should be success |
| 32 | + The output should include "Explore this snapshot at https://app.snyk.io/org/" |
| 33 | + The output should include "Notifications about newly disclosed issues related to these dependencies will be emailed to you." |
| 34 | + The stderr should equal "" |
| 35 | + End |
| 36 | + End |
| 37 | + |
| 38 | + Describe "monitor npm project with JSON output" |
| 39 | + It "monitors a project and outputs a valid JSON" |
| 40 | + When run snyk monitor ../fixtures/basic-npm --json |
| 41 | + The status should be success # issues found |
| 42 | + The output should include '"ok": true,' |
| 43 | + The stderr should equal "" |
| 44 | + The result of function check_valid_json should be success |
| 45 | + End |
| 46 | + End |
| 47 | +End |
0 commit comments