cd frontend
bun run test # unit + worker tests
bun run test:unit # frontend/tests only
bun run test:coverage # lcov + text under coverage/
bun run test:coverage:gate # coverage + scoped line gate
bun run test:security # tests/security/
bun run test:e2e:smoke # Playwright @smoke (builds + preview)
bun run test:all # coverage gate + securityFrom repo root:
bun run test:frontend
bun run test:frontend:coveragefrontend/tests/
setup.ts # localStorage / document stubs
fixtures/ # bars, plugin modules
helpers/ # mock-fetch, mock-ws
*.test.ts # unit suites
integration/ # run-pipeline, load-symbol, library-service
security/ # (Phase D)
frontend/scripts/check-coverage.mjs
frontend/e2e/
smoke.spec.ts # @smoke Playwright
frontend/playwright.config.ts
frontend/worker/tests/ # auth, keys, runtime, scripts
cd frontend
bun install
bunx playwright install chromium
bun run test:e2e:smoke # @smoke only (PR CI)
bun run test:e2e:critical # @smoke + @critical
bun run test:e2e # all specs- Mocks
/runand Binance so smoke does not need a live Pro API. - Selectors use
data-testidon topbar / manager (axis-btn-load,axis-manager, …). - CI:
.github/workflows/ci.ymlruns unit + security + Playwright@smokeon PR / main. Optional firehose bench:bun run test:bench(AXIS_BENCH=1).
bun run test:securityCovers plugin URL schemes, storage-via-URL reject, poisoned localStorage, worker partition isolation, If-Match 409, admin keys.
- Gate: 95% lines on scoped core (ratchet: 70 → 80 → 83 → 87 → 90 → 95).
- Include: plugins, storage (minus idb), store, results, sources, streams, data, chart pure helpers + series-factory/manager-access, worker auth/keys/runtime/scripts.
- Excluded from gate:
drawing-layer.ts,pane-manager(unit-tested),runnerchart apply, pyodide boot, legacy JS, Solid UI.tsx. - Full unscoped report:
bun test --coverage.
| Module | Notes |
|---|---|
storage/local.ts, cloud.ts, git*.ts |
Error paths, migration edges |
results/strategy.ts |
Multi-id, formatters, CSV |
chart/pyne-drawings.ts |
polyline / aliases |
| File | Covers |
|---|---|
tests/integration/run-pipeline.test.ts |
server engine mock /run |
tests/integration/load-symbol.test.ts |
mock-walk → store.bars |
tests/integration/library-service.test.ts |
storage façade |
tests/integration/live-rerun.test.ts |
multiplex start/stop |
tests/integration/plugin-install.test.ts |
fixture URL → registry |
tests/integration/persist.test.ts |
AXIS key shape (debounced) |
- Import
./setupfirst when tests touch store/plugins/storage. - No real network (mock
fetch/ WebSocket). - Prefer table-driven tests for catalog built-ins.
- Plugin fixtures live in
tests/fixtures/plugins/.
- Create
tests/<area>.test.ts. import './setup'if needed.- Use fixtures from
tests/fixtures/. - Run
bun run test:unitandbun run test:coverage:gate.
See the session testing plan for Phases B–D (streams, chart, e2e, security).