Skip to content

Commit

Permalink
fix: prevent duplicate errors (#18)
Browse files Browse the repository at this point in the history
This works by filtering any errors that were emitted from a file different to the current file being tested.
  • Loading branch information
tom-sherman authored and azz committed Oct 16, 2019
1 parent c5e9fcc commit bc566e0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/runTsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ const runTsc = ({ testPath, config: jestConfig }) => {

const allDiagnostics = ts
.getPreEmitDiagnostics(program)
.concat(emitResult.diagnostics);
.concat(emitResult.diagnostics)
.filter(diagnostic => diagnostic.file.fileName === testPath);

const errors = allDiagnostics
.map(diagnostic => {
Expand Down

0 comments on commit bc566e0

Please sign in to comment.