Skip to content

Commit a2a6a28

Browse files
committed
Fix diagnostics tests
The tests read "on compile" but the test code was not simulating a compilation, causing the diagnostics to not be pruned
1 parent 24f60ad commit a2a6a28

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

apps/expert/test/expert/project/diagnostics_test.exs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,12 @@ defmodule Expert.Project.DiagnosticsTest do
6969

7070
Document.Store.get_and_update(document.uri, &Document.mark_clean/1)
7171

72+
Engine.Api.broadcast(project, project_compile_requested())
7273
Engine.Api.broadcast(project, project_diagnostics(diagnostics: []))
7374

7475
assert_receive {:transport,
7576
%TextDocumentPublishDiagnostics{
76-
params: %PublishDiagnosticsParams{diagnostics: nil}
77+
params: %PublishDiagnosticsParams{diagnostics: []}
7778
}}
7879
end
7980

@@ -89,11 +90,13 @@ defmodule Expert.Project.DiagnosticsTest do
8990
assert_receive {:transport, %TextDocumentPublishDiagnostics{}}, 500
9091

9192
Document.Store.close(document.uri)
93+
94+
Engine.Api.broadcast(project, project_compile_requested())
9295
Engine.Api.broadcast(project, project_diagnostics(diagnostics: []))
9396

9497
assert_receive {:transport,
9598
%TextDocumentPublishDiagnostics{
96-
params: %PublishDiagnosticsParams{diagnostics: nil}
99+
params: %PublishDiagnosticsParams{diagnostics: []}
97100
}}
98101
end
99102

0 commit comments

Comments
 (0)