An open API service indexing awesome lists of open source software.

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

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