Skip to content

Commit

Permalink
Improve output when TSC check fails
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjm committed Jun 28, 2023
1 parent a80b62c commit c8e64b6
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions test/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,19 @@ testTypeCheckDeclarations tsDeclarations typesAndVals = withSystemTempDirectory
writeFile tsFile contents

tsc <- getTSC
(code, output, _err) <- readProcessWithExitCode tsc ["--strict", "--noEmit", "--skipLibCheck", "--traceResolution", "--noResolve", tsFile] ""
(code, sout, serr) <- readProcessWithExitCode tsc ["--strict", "--noEmit", "--skipLibCheck", "--traceResolution", "--noResolve", tsFile] ""

when (code /= ExitSuccess) $ do
error [i|TSC check failed: #{output}. File contents were\n\n#{contents}|]
when (code /= ExitSuccess) $
error [__i|TSC check failed.
File contents:
#{contents}

return ()
Stdout:
#{sout}

Stderr:
#{serr}
|]


ensureTSCExists :: IO ()
Expand Down

0 comments on commit c8e64b6

Please sign in to comment.