Skip to content

Commit 33f1295

Browse files
committed
Test disabling of diagnostics
1 parent 223151b commit 33f1295

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

server/src/test/kotlin/org/javacs/kt/DiagnosticTest.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ class DiagnosticTest : SingleFileTestFixture("diagnostic", "Diagnostics.kt") {
3333
assertThat(warnings, empty<Diagnostic>())
3434
}
3535

36+
@Test fun `disable diagnostics`() {
37+
languageServer.config.diagnostics.enabled = false
38+
39+
// Trigger a diagnostics update via a dummy change.
40+
replace(file, 1, 1, "", " ")
41+
languageServer.textDocumentService.debounceLint.waitForPendingTask()
42+
43+
assertThat(diagnostics, empty<Diagnostic>())
44+
}
45+
3646
@Test fun `only lint once for many edits in a short period`() {
3747
var text = "1"
3848
for (i in 1..10) {

0 commit comments

Comments
 (0)