Skip to content

Commit

Permalink
ValentinH#30: Respect Jest --noStackTrace flag
Browse files Browse the repository at this point in the history
  • Loading branch information
aguillotc committed Jan 28, 2023
1 parent c74518a commit 90e0088
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ const init = ({
const stackLines = stack.split('\n')
return (
`${chalk.red(message)}\n` +
`${stackLines
.map((line, index) => {
`${process.argv.indexOf("--noStackTrace") !== -1
? chalk.white(stackLines.slice(-1))
: stackLines.map( (line, index) => {
if (index === stackLines.length - 1) {
return chalk.white(line)
}
Expand Down

0 comments on commit 90e0088

Please sign in to comment.