From 07fe32fa6bda654a0a5fd8fdb2e50c412b0cc2cf Mon Sep 17 00:00:00 2001 From: y-agent-ai Date: Sun, 22 Mar 2026 19:17:02 +0800 Subject: [PATCH] docs(tests): update test documentation to reflect current test structure and commands Update README.md in the test directory, including: - More detailed test type descriptions - Updated test commands - Changed frontend testing tool from pytest to Vitest - Added frontend test directory layout explanation --- tests/README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/README.md b/tests/README.md index d62dfd8f..4f30304f 100644 --- a/tests/README.md +++ b/tests/README.md @@ -3,30 +3,30 @@ The test tree is organized with a clear backend/frontend split: - `tests/backend` - - backend unit tests - - backend integration tests + - backend unit tests, integration tests, and contract tests + - driven by `pytest` - regression tests directly related to `py-src/data_formulator/**` - `tests/frontend` - - frontend-related contract tests driven by `pytest` - - focused on request/response boundary behavior - - not intended for React component-level unit tests yet + - frontend unit tests powered by **Vitest** + **@testing-library/react** (jsdom) + - covers pure functions, Redux selectors, and React component rendering + - see `tests/frontend/README.md` for directory layout details ## Suggested Commands -Run all tests: - -```bash -pytest -``` - -Run backend tests only: +Run backend tests (pytest): ```bash pytest tests/backend ``` -Run frontend contract tests only: +Run frontend tests (Vitest): ```bash -pytest tests/frontend +npm test +``` + +Run frontend tests in watch mode: + +```bash +npm run test:watch ```