Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fabogit/testing
Tests using Vitest library (Jest)
https://github.com/fabogit/testing
jest tdd test unit-testing vitest
Last synced: 8 days ago
JSON representation
Tests using Vitest library (Jest)
- Host: GitHub
- URL: https://github.com/fabogit/testing
- Owner: fabogit
- Created: 2022-06-20T16:59:42.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-06-22T09:55:10.000Z (over 2 years ago)
- Last Synced: 2024-11-06T20:37:59.027Z (about 2 months ago)
- Topics: jest, tdd, test, unit-testing, vitest
- Language: JavaScript
- Homepage:
- Size: 147 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# testing
Testing using Jest and Vitest
- KISS: fail easy to easy debug
- Only test one thing/feature/behaviour (validate input OR transform it)
- Arrange, Act, Assert
- Don't test 3d party code (fetch(), querySelector() ecc..)
`npm install vitest --save-dev`
in `package.json` use
- for `server` testing, default environment `node`
```
"scripts": {
"test": "vitest --run --reporter verbose",
"test:watch": "vitest"
},
```- for `client` testing, environment `jsdom` (jest) `happy-dom` (vitest)
```
"scripts": {
"test": "vitest --run --environment happy-dom"
},
````npm test`
https://vitest.dev/
https://vitest.dev/guide/migration.html
https://testing-library.com/