Files
wehub-resource-sync c6af9e284a
Tests / catch-all (windows-latest) (push) Has been cancelled
Tests / jvm (macos-latest) (push) Has been cancelled
Tests / jvm (ubuntu-latest) (push) Has been cancelled
Tests / jvm (windows-latest) (push) Has been cancelled
Tests / native (macos-latest) (push) Has been cancelled
Tests / native (ubuntu-latest) (push) Has been cancelled
Tests / native (windows-latest) (push) Has been cancelled
Tests / niche (ubuntu-latest) (push) Has been cancelled
Tests / other-langs (macos-latest) (push) Has been cancelled
Tests / other-langs (ubuntu-latest) (push) Has been cancelled
Tests / other-langs (windows-latest) (push) Has been cancelled
Tests / catch-all (macos-latest) (push) Has been cancelled
Tests / catch-all (ubuntu-latest) (push) Has been cancelled
Docs Build / build (push) Has been cancelled
Docs Build / deploy (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (javascript-typescript) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Codespell / Check for spelling errors (push) Has been cancelled
Build and Push Docker Images / build-and-push (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:39:38 +08:00

28 lines
1.3 KiB
Python

"""
Diagnostics smoke test for the HTML language server.
``vscode-html-language-server`` does not validate HTML structure itself — upstream
``vscode-html-languageservice`` only forwards validation to embedded sub-services
(CSS/JS in ``<style>`` / ``<script>`` blocks), and those aren't wired up in
standalone mode. So a malformed-HTML fixture would yield zero diagnostics regardless.
Asserting "at least one diagnostic" would be a false positive waiting to happen.
Instead, this test verifies the diagnostics endpoint is reachable end-to-end and
the framework's pull→publish fallback handles the empty response correctly — i.e.
it returns a list, not an error. That alone catches LS-crash regressions on the
diagnostic request, which is the practical purpose for this LS.
"""
import pytest
from solidlsp import SolidLanguageServer
from solidlsp.ls_config import Language
@pytest.mark.html
class TestHtmlDiagnostics:
@pytest.mark.parametrize("language_server", [Language.HTML], indirect=True)
def test_diagnostics_endpoint_returns_list(self, language_server: SolidLanguageServer) -> None:
diagnostics = language_server.request_text_document_diagnostics("diagnostics_sample.html", min_severity=1)
assert isinstance(diagnostics, list), diagnostics