Skip to content

Commit

Permalink
e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
goulvenclech committed Dec 19, 2024
1 parent 79dc4d9 commit a3da0e2
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
body {
background-color: #fff;
}

a {
color: red;
}

h1.foo {
color: rgba(0, 0, 0, 0.5);
}

h1 > span {
color: linear-gradient(to right, red, #fff);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { afterAll, bench, describe } from "vitest";
import { startLanguageServer } from "../../server";
import { fileURLToPath } from "url";

const filePath = fileURLToPath(
new URL("../../../fixture/document_symbols_benchmark.css", import.meta.url)
);

const weblsp = await startLanguageServer(undefined, "weblsp");
const weblspUri = (await weblsp.openTextDocument(filePath, "css")).uri;

const vscodeLsp = await startLanguageServer(undefined, "vscode-css");
const vscodeLspUri = (await vscodeLsp.openTextDocument(filePath, "css")).uri;

describe("DocumentSymbols", async () => {
bench("weblsp - DocumentSymbols", async () => {
await weblsp.sendDocumentSymbolRequest(weblspUri);
});

if (!process.env.CODSPEED) {
bench("vscode-css-languageserver - DocumentSymbols", async () => {
await vscodeLsp.sendDocumentSymbolRequest(vscodeLspUri);
});
}

afterAll(async () => {
await weblsp.shutdown();
await vscodeLsp.shutdown();
await weblsp.exit();
await vscodeLsp.exit();
});
});

0 comments on commit a3da0e2

Please sign in to comment.