Closed Xavier-IV closed 1 year ago
You can use this as a base to setup your project to use test.
Using Vitest: https://vitest.dev/
But any prior experience with Jest will do as well.
# One time execution, useful for pipeline $ yarn test # Continuously watch changes on spec $ yarn test:watch
Example output ran:
$ vitest run RUN v0.33.0 /Users/zafranudin.zafrin/Projects/learn/ratemysurau ✓ src/utils/random.spec.ts (2) ✓ src/utils/uploadthing.spec.ts (3) ✓ src/server/services/generate-surau-verification.spec.ts (3) Test Files 3 passed (3) Tests 8 passed (8) Start at 18:26:01 Duration 298ms (transform 128ms, setup 0ms, collect 156ms, tests 10ms, environment 0ms, prepare 201ms) ✨ Done in 1.30s.
This is by no mean a complete test, you can keep on adding more with the example I provided. Feel free to add this into the pipeline as well.
Also this does not cover e2e and frontend test, but its a good start.
For approvers, kindly verify with pull/clone first, since I'm not sure if it'll break any local setup you might have.
Otherwise I don't see any breaking changes.
Overview
You can use this as a base to setup your project to use test.
Using Vitest: https://vitest.dev/
But any prior experience with Jest will do as well.
Usage
Example output ran:
Disclaimer
This is by no mean a complete test, you can keep on adding more with the example I provided. Feel free to add this into the pipeline as well.
Also this does not cover e2e and frontend test, but its a good start.