Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions scripts/snyk-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,20 @@ async function snykTest(cwd) {
'--dev',
`--json-file-output=${tmpPath}`,
],
{ cwd, stdio: 'inherit' },
// Do not print anything to the console.
{ cwd, stdio: 'ignore' },
);
} catch (err) {
console.warn(err);
throw new Error(
console.log(
'temporarily re-add',
)`Snyk test failed to produce results for ${cwd}. Check the report for details.`,
);
}

const res = JSON.parse(await fs.readFile(tmpPath));
console.info(`testing ${cwd} done.`);
console.info(`Testing ${cwd} completed.`);
return res;
} catch (err) {
console.error(`testing ${cwd} failed. ${err.message}`);
throw err;
} finally {
try {
await fs.rm(tmpPath);
Expand Down Expand Up @@ -73,6 +75,6 @@ async function main() {
}

main().catch((err) => {
console.error('Snyk test failed:', err);
console.error('Snyk Test Failed:', err.message);
process.exit(1);
});
Loading