mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-10 02:02:31 +08:00
docs: add testing section to CONTRIBUTING.md
This commit is contained in:
24
.github/CONTRIBUTING.md
vendored
24
.github/CONTRIBUTING.md
vendored
@@ -24,11 +24,33 @@ Pre-commit hooks via Husky will run Biome automatically on staged files.
|
|||||||
|
|
||||||
For a better experience, install the [Biome VS Code extension](https://marketplace.visualstudio.com/items?itemName=biomejs.biome) for real-time linting and format-on-save.
|
For a better experience, install the [Biome VS Code extension](https://marketplace.visualstudio.com/items?itemName=biomejs.biome) for real-time linting and format-on-save.
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
|
||||||
|
Run tests before submitting PRs:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run test # Unit tests (Vitest)
|
||||||
|
npm run test:e2e # E2E tests (Playwright)
|
||||||
|
```
|
||||||
|
|
||||||
|
E2E tests use mocked API responses - no AI provider needed. Tests are in `tests/e2e/`.
|
||||||
|
|
||||||
|
To run a specific test file:
|
||||||
|
```bash
|
||||||
|
npx playwright test tests/e2e/diagram-generation.spec.ts
|
||||||
|
```
|
||||||
|
|
||||||
|
To run tests with UI mode:
|
||||||
|
```bash
|
||||||
|
npx playwright test --ui
|
||||||
|
```
|
||||||
|
|
||||||
## Pull Requests
|
## Pull Requests
|
||||||
|
|
||||||
1. Create a feature branch
|
1. Create a feature branch
|
||||||
2. Make changes and ensure `npm run check` passes
|
2. Make changes and ensure `npm run check` passes
|
||||||
3. Submit PR against `main` with a clear description
|
3. Run tests with `npm run test:e2e`
|
||||||
|
4. Submit PR against `main` with a clear description
|
||||||
|
|
||||||
## Issues
|
## Issues
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user