Skip to content

Commit bc566e0

Browse files
tom-shermanazz
authored andcommitted
fix: prevent duplicate errors (#18)
This works by filtering any errors that were emitted from a file different to the current file being tested.
1 parent c5e9fcc commit bc566e0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/runTsc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ const runTsc = ({ testPath, config: jestConfig }) => {
5050

5151
const allDiagnostics = ts
5252
.getPreEmitDiagnostics(program)
53-
.concat(emitResult.diagnostics);
53+
.concat(emitResult.diagnostics)
54+
.filter(diagnostic => diagnostic.file.fileName === testPath);
5455

5556
const errors = allDiagnostics
5657
.map(diagnostic => {

0 commit comments

Comments
 (0)