Skip to content

Commit

Permalink
Prettier stack trace
Browse files Browse the repository at this point in the history
  • Loading branch information
chenglou committed Sep 23, 2020
1 parent a69cb90 commit 6303e3c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions tests/Tests.bs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions tests/Tests.re
Expand Up @@ -41,13 +41,14 @@ let run = (loc, left, comparator, right) => {
let left = Js.String.make(left);
let right = Js.String.make(right);
let codeFrame = codeFrameColumns(fileContent, {"start": {"line": line}}, {"highlightCode": true})
let errorMessage =
{j| \u001b[31mTest Failure: \u001b[39m$file
let errorMessage = {j|
\u001b[31mTest Failure!
\u001b[36m$file\u001b[0m:\u001b[2m$line
$codeFrame
\u001b[31mLeft:\u001b[39m $left
\u001b[31mRight:\u001b[39m $right
\u001b[39mLeft: \u001b[31m$left
\u001b[39mRight: \u001b[31m$right\u001b[0m
|j};
Js.log(errorMessage);
// API: https://nodejs.org/api/errors.html#errors_error_capturestacktrace_targetobject_constructoropt
Expand Down

0 comments on commit 6303e3c

Please sign in to comment.