Skip to content

Instantly share code, notes, and snippets.

@foolip
Last active September 15, 2019 07:26
Show Gist options
  • Save foolip/b630c0432ed1a35f0758dd9d01b1fb1b to your computer and use it in GitHub Desktop.
Save foolip/b630c0432ed1a35f0758dd9d01b1fb1b to your computer and use it in GitHub Desktop.
const fs = require('fs');
const path = require('path');
const PREFIX = 'set_file_is_test called from ';
const args = process.argv.slice(2)
for (const reportPath of args) {
const name = path.basename(reportPath, '.json');
const report = JSON.parse(fs.readFileSync(reportPath));
for (const result of report.results) {
if (result.status === 'ERROR' && result.message &&
result.message.startsWith(PREFIX)) {
const context = result.message.substr(PREFIX.length);
console.log(name, context, result.test);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment