Loading...
Loading...
Test, debug, and validate Bascik sites. Use when writing Vitest unit tests or Playwright E2E tests for a Bascik project, choosing locators that survive production identifier minification, debugging component scripts, build scripts, or server scripts in VS Code or browser DevTools, validating compiled dist/ HTML against the WHATWG spec, running bascik --check and the language server linter in CI, or reaching Lighthouse 100 scores.
npx skill4agent add bascikdev/bascik bascik-testingbascikscripts/verify.mjsnpx bascik --check@bascik/language-servernode <skills-dir>/bascik/scripts/verify.mjsnpx vitest runBASCIK_SITE_URL=https://example.com npx bascik --builddist/verify.mjs --buildnpx playwright testbascik --check && vitest run && bascik --build && playwright testbascik --checkbascik-language-server --check <dir><script type="text/typescript">--typescriptbascik --check --typescripttypescript@bascik/language-serverread-doc.mjs /cli#typescript-errors-with-typescript.tssrc/components/docs-search/search-logic.ts<script src="search-logic.ts"></script>minify.js.tssearch-logic.test.tsvitest@vitest/coverage-v8vitevitest/configread-doc.mjs /testing/unit-testing// vite.config.ts
import { defineConfig } from "vitest/config";
export default defineConfig({ test: { include: ["src/**/*.test.ts"] } });.tssrc/lib/src/api/*.test.tsbascik --serverhtml@bascik/bascik/htmlString(output)expect(String(output)).toContain("Seattle")SafeHtmlstringserverScriptOutput(await handler(request, context, { signal })).text@bascik/bascik/runtimeString().errorResponseErrorread-doc.mjs /testing/server-scriptsbascik --buildminify.identifiers.my-card#btngetByTestId(...)data-testid="<component-name>"data-testid="<component-name>-<part>"bascikverify.mjsdata-testidgetByRole(...)getByLabel(...)getByText(...).filter({ hasText: "..." })data-testid.bascik__my-card__title.nth(N)locator('..')bascik --buildbascik --serverimport { test, expect } from "@playwright/test";
test("each like button toggles independently", async ({ page }) => {
await page.goto("/");
const buttons = page.getByTestId("like-button");
await buttons.first().click();
await expect(buttons.first()).toHaveAttribute("aria-pressed", "true");
await expect(buttons.last()).toHaveAttribute("aria-pressed", "false");
});read-doc.mjs /how-to/agent-migration#finding-responsive-defectsbascik-refactorparse5bascik --checkdist/dist/**/*.htmlparse5onParseErrorread-doc.mjs /testing/component-testingsrc/components/<name>/<name>.html<name>.html?instance=2debugger;node <skills-dir>/bascik/scripts/preview.mjs --page src/pages/x.htmlscripts.cache.excludenode_modules/.cache/bascik/script-cacheread-doc.mjs /testing/debugging/testing/source-mapswidthheightloading="lazy"defer<title>lang<html>read-doc.mjs /lighthouse/performance/lighthouse/accessibility/lighthouse/best-practices/lighthouse/seo/lighthouse/agentic-browsingbascik-refactor/scripts/lighthouse-gate.mjsbascik-refactornpx skills add bascikdev/bascik --skill bascik-refactor| How do I... | Read |
|---|---|
| Unit test helpers and handlers | |
| Test components in a browser | |
| Test build, server, and exec scripts | |
| Lint in CI | |
| Handle false editor linter warnings | |
| Fix a known problem | |
node <skills-dir>/bascik/scripts/read-doc.mjs <path>