Skip to content

Commit

Permalink
fix: nuget plugin writes messages to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
37IulianPopovici committed Aug 16, 2024
1 parent 2c934a6 commit 459d1e6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"snyk-mvn-plugin": "3.5.0",
"snyk-nodejs-lockfile-parser": "1.58.7",
"snyk-nodejs-plugin": "1.3.2",
"snyk-nuget-plugin": "2.7.4",
"snyk-nuget-plugin": "2.7.6",
"snyk-php-plugin": "1.9.2",
"snyk-policy": "^1.25.0",
"snyk-python-plugin": "2.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,8 @@ describe('`snyk test` of basic projects for each language/ecosystem', () => {
// libraries.
expect([0, 1]).toContain(code);

// Note: dotnet plugin can print a warning about runtime resolution, which breaks JSON output.
// This replacement regex is a temporary workaround until the dotnet plugin can be fixed.
const sanitizedStdout = stdout.replace(/^[\s\S]*?{/, '{');
const result = JSON.parse(sanitizedStdout);
// Checking if the JSON output is correctly defined and is not poluted with user facing messages.
const result = JSON.parse(stdout);
expect(result?.ok).toBeDefined();

// Expect 'ok' to be true if exit 0, false if exit 1.
Expand Down

0 comments on commit 459d1e6

Please sign in to comment.