This guide documents the validation steps that exist in the current Next.js-based website repo.
The current project scripts are:
pnpm devpnpm buildpnpm startpnpm testpnpm coveragepnpm update-snappnpm lintpnpm formatpnpm format:check
Unit tests are colocated with the source they cover using __tests__
directories, following the same layout used in adoptium.net.
The first baseline suite currently covers src/lib/posts.ts from src/lib/tests/posts.test.ts.
Component tests live inside each component folder, for example
src/components/Header/__tests__/Header.test.tsx. Snapshot files are added
selectively under __snapshots__ when they provide stable, useful coverage.
See 04-components.md for the full component layout
convention.
App-level tests live under src/app/__tests__, for example
src/app/__tests__/not-found.test.tsx and
src/app/__tests__/sitemap.test.ts.
Although some testing dependencies are installed, the current CI workflows only enforce formatting, linting, and a production build.
Run these before opening a pull request:
pnpm format:check
pnpm lint
pnpm test
pnpm buildIf you changed files under src/, it is often useful to run:
pnpm formatthen re-run:
pnpm format:checkRuns Prettier on source files under src/**/*.{js,jsx,ts,tsx,json}.
Notes:
- this does not automatically format Markdown docs
- this does not rewrite files outside the configured
src/glob
Checks whether the files covered by the Prettier glob are already formatted.
Use this before committing source changes.
Runs ESLint across the repo using the Next.js configuration in
eslint.config.js.
This catches common TypeScript, React, and App Router issues.
Runs the Vitest suite once in jsdom.
Tests live beside the code they cover inside __tests__ directories, for
example src/lib/__tests__/posts.test.ts.
Runs the same Vitest suite with V8 coverage enabled.
Use this when you want a local coverage report while expanding the baseline test surface.
Runs the Vitest suite in snapshot update mode.
Use this after intentionally changing stable UI output that already has snapshot coverage.
Runs:
pnpm sync:repo-stats && next buildThis is the closest thing to a production validation step and should pass before opening a PR.
Runs:
pnpm sync:repo-stats && next devUse this while developing to preview page changes at http://localhost:3000.
The current CI workflow runs:
pnpm install --frozen-lockfilepnpm format:checkpnpm lintpnpm testpnpm build
If one of these fails locally, it will likely fail in GitHub Actions too.
- open
/blog - open the individual post route
- confirm the post is not accidentally left as draft
- verify featured and inline image paths
- open the route locally
- verify front matter values render correctly
- confirm stripped shortcodes are not needed for the page
There is no translation or locale test matrix because the site does not currently implement i18n.
Keep validation focused on the single English site.