Skip to content

Optimize tests - #256

Merged
hirasso merged 5 commits into
mainfrom
fix/smoke-tests
Nov 10, 2026
Merged

hirasso merged 5 commits into
mainfrom
fix/smoke-tests

Conversation

@hirasso

@hirasso hirasso commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Closes #255

npm test validated 0 pages and always passed. This fixes the validator run and adds browser smoke tests.

Changes

  • Update @swup/cli to 5.0.5: swup validate now reads the sitemap (61/61 pages validated) and fails if it finds no pages. The existing animation checks are kept.
  • Fix test:serve: --silent _site made _site the value of --silent, so the test server served the repo root instead of the built site
  • Add Playwright smoke tests (tests/smoke.spec.mjs, run via npm run test:e2e, part of npm test):
    • initial load
    • swup navigation without a full reload
    • back navigation
    • switching to each theme (Fade, Overlay, Slide), then navigating with it
    • every test fails on uncaught JS errors
    • third-party requests (analytics) are blocked to keep tests hermetic
  • Rename swup.config.js to swup.config.mjs to silence Node's MODULE_TYPELESS_PACKAGE_JSON warning
  • Add @swup/prettier-config as a devDependency (it was only installed via @swup/plugin)
  • Flaky tests fixed in the cli

Checks

  • The PR is submitted to the main branch
  • All tests are passing (npm run test)
  • New or updated tests are included

- initial load, swup navigation without full reload, back navigation, theme switching
- fail on uncaught JS errors
- fix test:serve serving the repo root (--silent swallowed _site)

@see #255
Validates all sitemap pages now. .mjs silences Node's MODULE_TYPELESS_PACKAGE_JSON warning

@see #255
Was only installed transitively via @swup/plugin
@hirasso
hirasso requested a review from daun November 9, 2026 20:51
@hirasso hirasso changed the title Fix/smoke tests Optimize tests Nov 9, 2026
daun
daun previously approved these changes Nov 9, 2026
@daun

daun commented Nov 9, 2026

Copy link
Copy Markdown
Member

🍇

@hirasso

hirasso commented Nov 9, 2026 •

Copy link
Copy Markdown
Member Author

Putting this on hold until swup/cli#68 is merged and released....

5.0.5 checks animation styles without timing, so --parallel is no longer flaky
@hirasso

hirasso commented Nov 9, 2026 •

Copy link
Copy Markdown
Member Author

Flaky tests are fixed upstream in swup/cli 5.0.5! Ready to finally merge this. That Validate swup.js.org in CI is not really required but good to have anyways.

@hirasso
hirasso merged commit c34526c into main Nov 10, 2026
1 check passed
@hirasso
hirasso deleted the fix/smoke-tests branch November 10, 2026 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: tests are running against 0 pages

2 participants