release: v0.16.0
See CHANGELOG.md for the full v0.16.0 entry. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: ralksta <ralksta@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Co-authored-by: Ralf <rohlenbo79@gmail.com> Co-authored-by: Paul Thies <110185070+ImScheinox@users.noreply.github.com> Co-authored-by: lancetm714 <108419425+lancetm714@users.noreply.github.com>
This commit is contained in:
@@ -55,6 +55,26 @@ npx vitest run # all tests must pass
|
||||
npm run build # build must succeed
|
||||
```
|
||||
|
||||
## Tests
|
||||
|
||||
Tests live in `__tests__/` next to the code they cover, and run in Node by
|
||||
default — most of what is worth testing is plain logic.
|
||||
|
||||
A test that needs a DOM opts in per file, with this as its very first line:
|
||||
|
||||
```tsx
|
||||
// @vitest-environment jsdom
|
||||
```
|
||||
|
||||
Then render with `@testing-library/react` and call `cleanup` in `afterEach`.
|
||||
See `app/admin/__tests__/SaveBar.test.tsx` for a worked example.
|
||||
|
||||
**Prefer extracting the logic over rendering it.** A pure function moved into
|
||||
`lib/` — or into a sibling module, as `page-builder/albumEntries.ts` was — is
|
||||
cheaper to test and stays tested when the markup around it changes. Reach for a
|
||||
component test when the behaviour *is* the rendering: a state that hides a form,
|
||||
a control that must stay disabled, a keyboard shortcut.
|
||||
|
||||
## Code style
|
||||
|
||||
- **TypeScript** — strict mode, no `any` without justification
|
||||
|
||||
Reference in New Issue
Block a user