Last active
September 4, 2017 22:26
-
-
Save ncuillery/3bbeda72a267447a38c47b236acd907a to your computer and use it in GitHub Desktop.
Medium buddybuild/ESLint
This file contains 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
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