Skip to content

Instantly share code, notes, and snippets.

@another-guy
Last active March 4, 2019 09:47
Show Gist options
  • Save another-guy/0d76eedb09d54db9a11f56c86f416895 to your computer and use it in GitHub Desktop.
Save another-guy/0d76eedb09d54db9a11f56c86f416895 to your computer and use it in GitHub Desktop.
Improved then block
.then(jestCliCallResult => {
jestCliCallResult.results.testResults
.forEach(testResult => {
testResult.testResults
.filter(assertionResult => assertionResult.status === 'passed')
.forEach(({ ancestorTitles, title, status }) => {
console.info(` ● ${ancestorTitles} › ${title} (${status})`);
});
});
jestCliCallResult.results.testResults
.forEach(testResult => {
if (testResult.failureMessage) {
console.error(testResult.failureMessage);
}
});
reportTestResults(undefined, jestCliCallResult.results.numFailedTests);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment