code testing

writing and organizing test

For Unit tests it's best that test files sit right alongside the module or component they test.

src/
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ Button.tsx
β”‚   β”œβ”€β”€ Button.test.tsx      <-- Co-located unit test
β”‚   └── Button.module.css
β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ formatCurrency.ts
β”‚   └── formatCurrency.test.ts

For E2E & integrations tests
Use ./tests for System-Level Tests: Reserve a root-level ./tests or ./e2e folder exclusively for end-to-end testing, heavy integration flows, or fixture data that spans the entire app.

Definitions

Examples

language specific

TS-JS testing
python testing