Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: capture valid json output with policy #5581

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thisislawatts
Copy link
Member

@thisislawatts thisislawatts commented Nov 13, 2024

Pull Request Submission Checklist

  • Follows CONTRIBUTING guidelines
  • Includes detailed description of changes
  • Contains risk assessment (Low | Medium | High)
  • Highlights breaking API changes (if applicable)
  • Links to automated tests covering new functionality
  • Includes manual testing instructions (if necessary)
  • Updates relevant GitBook documentation (PR link: ___)

What does this PR do?

Stepping back through the versions of snyk-policy the bug seems to have been introduced by adopting the vite bundler in version 3.0
Release v3.0.0 · snyk/policy

With v2.0.8, the CLI works as expected outputting valid JSON.

I have added an acceptance test for this behaviour with the CLI.
Note that the first line of stdout includes: snyk:module cxct@0.0.1-security => { name: "cxct", version: "0.0.1-security" } +0ms

You can get the test to pass by installing an older version of the CLI and injecting that to your tests:

export TEST_SNYK_COMMAND=/path/to/snyk
npx jest cli-json-output.spec.ts

@thisislawatts thisislawatts force-pushed the test/capture-valid-esoj-output-with-policy branch 2 times, most recently from 72bb996 to 85aaf21 Compare November 13, 2024 23:23
@thisislawatts thisislawatts force-pushed the test/capture-valid-esoj-output-with-policy branch from 85aaf21 to 49a872f Compare November 18, 2024 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant