Last active
September 15, 2019 07:26
-
-
Save foolip/b630c0432ed1a35f0758dd9d01b1fb1b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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