Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,13 @@ npm run docs:build
```

## Testing
Vitest runs in jsdom and aliases `obsidian` to `tests/mocks/obsidian.ts`.
Prefer unit tests for pure utility, parser, store, API, and component behavior.
Use Testing Library for Svelte component behavior instead of asserting on
implementation details.
Vitest runs in Node and aliases `obsidian` to `tests/mocks/obsidian.ts`. A test
file that needs a DOM or loads Svelte code starts with
`// @vitest-environment jsdom`; leave it off otherwise, because jsdom setup is
the suite's largest cost. A Node test that loads Svelte code or reads `window`
or `document` fails with that hint. Prefer unit tests for pure utility, parser,
store, API, and component behavior. Use Testing Library for Svelte component
behavior instead of asserting on implementation details.

When a bug depends on real Obsidian runtime behavior, reproduce it in Obsidian
before changing code and verify it there after the fix. Timestamp links, URI
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Other installation options can be found in the [documentation](https://chhoumann

## Development

- `npm run test` runs the accessibility checks and the jsdom/unit test suite.
- `npm run test` runs the accessibility checks and the unit test suite.
- `npm run build` type-checks and bundles the plugin.
- `npm run test:e2e` builds the plugin, then runs the local Obsidian-backed E2E suite.

Expand Down
Loading
Loading