0
Fork 0
mirror of https://github.com/TanStack/pacer.git synced 2026-11-16 06:59:03 +00:00
pacer/tests/e2e
Kevin Van Cott 9368fd1dca
build: Move to Oxlint and oxfmt and update dependencies (#309)
* build: Move to Oxlint and oxfmt and update dependencies

- Update all dependencies within the 1-day release-age window, one version
  per package repo-wide (TypeScript stays on 6.0.3; Octane 0.17.0 with
  @tsrx/oxc 0.23.0)
- Move Ember examples to Babel 8 by dropping the removed
  plugin-transform-runtime options
- Replace Prettier with oxfmt and ESLint with Oxlint via the shared TanStack
  configs; keep ESLint only for svelte-pacer template rules
- Align GitHub Actions pins with TanStack/config and Hotkeys

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
History 2026-11-14 12:54:49 -06:00
..
helpers build: Move to Oxlint and oxfmt and update dependencies (#309) 2026-11-14 12:54:49 -06:00
README.md feat(adapters): Add six frameworks and reactive option support (#273) 2026-10-05 08:28:36 -05:00
tsconfig.json feat(adapters): Add six frameworks and reactive option support (#273) 2026-10-05 08:28:36 -05:00

Example end-to-end tests

React, Preact, Solid, Angular, Vue, Svelte, Lit, Alpine, Ember, and Octane examples keep their Playwright specs in examples/<framework>/<example>/tests/e2e. Angular specs use .spec.mts so Playwright loads them as ES modules without changing the Angular application's module type. Each example has a smoke test and tests for the utility's visible behavior.

Run tests

Install dependencies from the repository root, then install Chromium:

pnpm install
pnpm test:e2e:install

Run all example tests, or only examples affected by your changes:

pnpm test:e2e
pnpm test:e2e:affected

Nx builds workspace dependencies before starting the tests. Each example gets one browser worker and its own development server on an available port. Nx runs two examples concurrently.

To run one example with its build dependencies:

pnpm exec nx run @tanstack/pacer-example-react-use-debouncer:test:e2e

After building dependencies, run Playwright directly to filter tests or debug:

pnpm exec playwright test --project='solid/*'
pnpm exec playwright test --project=react/useDebouncer
pnpm exec playwright test --project=react/useDebouncer --debug

Failed tests save screenshots and traces under test-results/. CI uploads them as an artifact. Open a trace with pnpm exec playwright show-trace <path-to-trace.zip>.

Add or change a test

Import test and expect from tests/e2e/helpers/fixtures. The exampleUrl worker fixture starts Vite with the example's configuration or starts Angular CLI for Angular examples. It closes the server when the worker finishes. Each test gets a fresh page; navigate to exampleUrl after registering any network routes or installing the Playwright clock.

Assert visible output and meaningful behavior such as coalescing calls, limiting executions, draining a queue, or processing a batch. Use accessible locators and scope repeated controls to their example section. Advance the Playwright clock for scheduled behavior instead of adding fixed sleeps.

The page fixture fails on uncaught browser errors and blocks the optional React Scan CDN script. Query tests mock JSONPlaceholder before navigation so test results do not depend on that service. Keep simulated failures deterministic and assert their displayed outcomes.

Register a new example's test:e2e script using the existing example manifests. Include its specs in the shared e2e TypeScript check. Run pnpm test:e2e:types to verify discovery for every framework example and check the config, fixtures, and specs. Run pnpm test:e2e:lint to lint them.