Skip to content

Commit 6df0a87

Browse files
committed
update TESTS.md to include TipTap mock
1 parent 65d0243 commit 6df0a87

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

packages/agentflow/TESTS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Presentational components that are mostly JSX. Only add tests if the component c
3434

3535
The Jest config uses file extensions to select the test environment:
3636

37+
<!-- prettier-ignore -->
3738
| Extension | Environment | When to use |
3839
| ----------- | ----------------------- | -------------------------------------------------------------------------- |
3940
| `.test.ts` | **node** (no DOM) | Pure logic — utilities, reducers, data transformations |
@@ -98,6 +99,8 @@ jest.mock('@/infrastructure/store', () => ({
9899

99100
**CSS/SVG** (`src/__mocks__/styleMock.js`): Empty object export for CSS and SVG imports.
100101

102+
**TipTap** (`src/__mocks__/@tiptap/`): Stubs for `@tiptap/react` and related ESM-only packages that cannot run in Jest's CommonJS environment. The RichTextEditor component is lazy-loaded in production, so these mocks only affect tests that import it directly.
103+
101104
### Custom Jest Environment
102105

103106
`src/__test_utils__/jest-environment-jsdom.js` intercepts `require('canvas')` and returns a mock before jsdom tries to load the native binary. This prevents build failures in environments without native canvas compilation.

0 commit comments

Comments
 (0)