30 lines
712 B
Markdown
30 lines
712 B
Markdown
To install dependencies:
|
|
```sh
|
|
bun install
|
|
```
|
|
|
|
To run:
|
|
```sh
|
|
bun run dev
|
|
```
|
|
|
|
open http://localhost:3000
|
|
|
|
## Tests
|
|
|
|
Run all backend tests:
|
|
```sh
|
|
bun run test
|
|
```
|
|
|
|
### Test naming convention
|
|
|
|
- `*.test.ts` or `*.spec.ts`: service-level tests. These run with the shared Prisma preload at `test/support/prisma.mock.ts`.
|
|
- `*.handler.test.ts`: handler-level tests. These should mock the service module locally with `mock.module(...)` and import the handler after the mock is in place.
|
|
|
|
### Recommended pattern
|
|
|
|
- Keep business logic tests focused on the service layer.
|
|
- Use handler tests only to verify request parsing, status mapping, and response shaping.
|
|
- Put shared Prisma mocking helpers in `test/support/`.
|