https://github.com/vicompany/component-unit-testing-workshop
Workshop to showcase how to test components
https://github.com/vicompany/component-unit-testing-workshop
Last synced: 8 months ago
JSON representation
Workshop to showcase how to test components
- Host: GitHub
- URL: https://github.com/vicompany/component-unit-testing-workshop
- Owner: vicompany
- Created: 2021-01-15T12:44:58.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-01-19T15:40:09.000Z (over 5 years ago)
- Last Synced: 2025-01-03T18:15:29.566Z (over 1 year ago)
- Language: JavaScript
- Size: 167 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Workshop Component Unit Testing
Testing components requires a different mindset and tools than testing regular javascript files. This repository includes some examples that highlight different ways of querying elements, testing rendering and dealing with events.
## Used tools
* [Jest](https://jestjs.io)
* [testing-library](https://testing-library.com)
* [testing-library/user-event](https://github.com/testing-library/user-event)
## Framework
* [Svelte](https://svelte.dev)
## Commands
* `npm install`: Install required dependencies
* `npm run storybook`: Run storybook to view components
* `npm test`: Run all available tests
* `npm run test:watch`: Automatically re-run tests when .spec and .svelte files change