feat(CI): modular testing and linting system + cursor rule

This commit is contained in:
2026-06-27 15:20:52 +09:30
parent 3213d0ca28
commit bdb1911e74
14 changed files with 114 additions and 69 deletions
@@ -0,0 +1,12 @@
/**
* @jest-environment jsdom
*/
import { runGlobalSearchSelfTests } from "./selfTests";
describe("globalSearch selfTests", () => {
it("all in-process cases pass", async () => {
const report = await runGlobalSearchSelfTests();
expect(report.failed).toBe(0);
expect(report.failures).toEqual([]);
});
});
@@ -22,12 +22,10 @@ import {
/**
* Lightweight in-process self-tests for the global-search overhaul.
*
* The repository does not (yet) ship with a test runner, so we instead
* expose a deterministic suite of assertions over the pure helpers that
* back active jobs and the passive observer. This is intentionally
* dependency-free so it can run inside the extension page (`window.
* globalSearchDebug.runSelfTests()`) and from any future Vitest harness
* without modification.
* Exposes a deterministic suite of assertions over the pure helpers that
* back active jobs and the passive observer. Runs in Jest via
* `selfTests.test.ts`, and inside the extension page via
* `window.globalSearchDebug.runSelfTests()`.
*/
interface TestCase {
@@ -141,7 +141,7 @@ export function htmlToPlainText(rawHtml: string): string {
}
});
let text = body.innerText || "";
let text = body.textContent || body.innerText || "";
text = text
.replace(/\u00A0/g, " ")