Skip to content

Instantly share code, notes, and snippets.

@ncuillery
Last active September 4, 2017 22:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ncuillery/3bbeda72a267447a38c47b236acd907a to your computer and use it in GitHub Desktop.
Save ncuillery/3bbeda72a267447a38c47b236acd907a to your computer and use it in GitHub Desktop.
Medium buddybuild/ESLint
let errors = 0;
eslintReport.forEach(entry => {
errors += entry.errorCount ? 1 : 0; // Count only 1 error in case of multiple errors in the same file
output.testResults[0].assertionResults.push({
status: entry.errorCount ? 'failed' : 'passed',
title: entry.filePath,
failureMessages: entry.messages.map(
// Transform the object-based ESLint message into a Jest-style string:
({ ruleId, message, line, column }) => `Error ${ruleId} at ${line}:${column}: ${message}`,
),
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment