Skip to content

Commit

Permalink
chore: add test runner
Browse files Browse the repository at this point in the history
  • Loading branch information
adguernier committed Aug 28, 2024
1 parent 3a2e8ae commit 8332ff2
Show file tree
Hide file tree
Showing 5 changed files with 7,073 additions and 3,691 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ dist-ssr
*.njsproj
*.sln
*.sw?
storybook-static/
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ start:
cd api && docker compose up -d
npm run build
npm run preview
@echo "Done!"
@echo "Done!"

interaction-test:
@echo "Running interaction test..."
npm run storybook:test -- --watch -u
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,17 @@ To stop the application, press `Ctrl+C` in the terminal and run the following co
make stop-api
```

#### Testing

Tests are written in Storybook [Play functions](https://storybook.js.org/docs/writing-stories/play-function). Storybook [test runner](https://storybook.js.org/docs/writing-tests/test-runner) turns all of your stories into executable tests. It is powered by [Jest](https://jestjs.io/) and [Playwright](https://playwright.dev/).

Before running tests, make sure to install playwright with the following command:
```bash
npx playwright install --with-deps
```

To run the [interactions-tests](https://storybook.js.org/docs/writing-tests/interaction-testing), run the following command:
```bash
make storybook # if not already running
make interaction-test
```
Loading

0 comments on commit 8332ff2

Please sign in to comment.