mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-10-26 21:26:39 +00:00
docs: keep frontend agent guidance within size budget (#6999)
This commit is contained in:
parent
64dab5897a
commit
072e48a338
@ -42,7 +42,12 @@ Webpack is the default development bundler. Use `DEER_FLOW_DEV_BUNDLER=turbo` wi
|
||||
|
||||
On Windows `pnpm dev` binds `127.0.0.1` by default because Hyper-V/winnat excluded port ranges can reject Next's default `0.0.0.0` bind with `EACCES` (#2870). Pass `pnpm dev -- --hostname 0.0.0.0` to listen on a LAN interface instead.
|
||||
|
||||
Rstest runs them as two projects (`rstest.config.ts`). `*.test.ts` / `*.test.tsx` run in a plain **node** environment — that is nearly the whole suite, and it is the default for anything that is pure logic. `*.dom.test.ts` / `*.dom.test.tsx` run in **happy-dom**, for tests that need a document: hooks driven through `renderHook` from `@testing-library/react`, and components. Keep the split — a DOM environment costs roughly 3x the runtime of the node suite, so tests that do not render should not opt into it. A hook whose behavior only exists under real React (effect ordering, cleanup on unmount, re-render on store change) belongs in a `.dom.test.*` file rather than a node test that mocks `react` itself.
|
||||
`rstest.config.ts` separates **node** (`*.test.ts` / `*.test.tsx`) for pure logic
|
||||
from **happy-dom** (`*.dom.test.ts` / `*.dom.test.tsx`) for components and hooks
|
||||
rendered with `@testing-library/react`'s `renderHook`. Keep the split: DOM tests
|
||||
cost roughly 3x more runtime. Hooks that depend on React effect ordering, unmount
|
||||
cleanup, or re-renders on store changes belong in `.dom.test.*`; do not mock React
|
||||
in node tests to cover those behaviors.
|
||||
|
||||
E2E tests live under `tests/e2e/` and use Playwright with Chromium. They mock all backend APIs via `page.route()` network interception and test real page interactions (navigation, chat input, streaming responses). Config: `playwright.config.ts`. The real-backend auth contract in `tests/e2e-real-backend/auth-disabled-contract.spec.ts` and `backend/tests/test_auth_me_permissions.py` pin the complete route-permission list; update both when adding registered permissions (including `projects:read/write/delete`).
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user