mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-05-14 10:05:25 -04:00
Update dev docs
This commit is contained in:
@@ -19,4 +19,17 @@ Then update the database:
|
||||
|
||||
```bash
|
||||
npx prisma migrate dev --name add-some-profile-variable
|
||||
```
|
||||
```
|
||||
|
||||
### Cover with tests
|
||||
|
||||
Best Practices
|
||||
|
||||
* Test Behavior, Not Implementation. Don’t test internal state or function calls unless you’re testing utilities or very critical behavior.
|
||||
* Use msw to Mock APIs. Don't manually mock fetch—use msw to simulate realistic behavior, including network delays and errors.
|
||||
* Don’t Overuse Snapshots. Snapshots are fragile and often meaningless unless used sparingly (e.g., for JSON response schemas).
|
||||
* Prefer userEvent Over fireEvent. It simulates real user interactions more accurately.
|
||||
* Avoid Testing Next.js Internals . You don’t need to test getStaticProps, getServerSideProps themselves—test what they render.
|
||||
* Use jest.spyOn() for Internal Utilities . Avoid reaching into modules you don’t own.
|
||||
* Don't test just for coverage. Test to prevent regressions, document intent, and handle edge cases.
|
||||
* Don't write end-to-end tests for features that change frequently unless absolutely necessary.
|
||||
Reference in New Issue
Block a user