Created
May 10, 2019 09:48
-
-
Save adrienjoly/e662374dcf4263bb8d62d4d3474ffada to your computer and use it in GitHub Desktop.
Generate HTML with colors from Jest test results
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
#!/usr/bin/env bash | |
# USAGE: ./generate-html-with-colors-from-jest-test-results.sh <file_name> | |
# => will create: | |
# - <file_name>.log (with color codes) | |
# - <file_name>-plain.log (without color codes) | |
# - <file_name>.html | |
FILENAME=$1 | |
npm test -- --colors > ${FILENAME}.log | |
./color-cat ${FILENAME}.log > ${FILENAME}-plain.html | |
cat ${FILENAME}.log | npx ansi2html-cli > ${FILENAME}.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment