Skip to content

Instantly share code, notes, and snippets.

@foolip foolip/set_file_is_test.js
Last active Sep 15, 2019

What would you like to do?
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
You can’t perform that action at this time.