Testing
We try to keep our testing workflow as simple as possible for the developers.
We use Playwright as our testing framework.
You can find all the tests in the e2e
folder.
We try and follow a test driven development approach, but not on a unit test level.
The idea is not to have a test for every small function, but to have a test for every feature.
"It doesn't matter how the app is working, as long as its working."
Setup
To run the tests you'll have to install the dependencies first.
You'll need to have Node.js installed.
Then run the following command in the e2e
folder of the project:
npm install
and
npx playwright install
Writing tests
This section is still under construction.
Running tests
Make sure you don't have the app or dev mode running when you run the tests.
To run the tests you simply have to execute the appropriate script for your OS.
scripts/run_tests_mac.sh
for macOS
scripts/run_tests_win.ps1
for Windows
scripts/run_tests_linux.sh
for Linux
This will do a few things for you automatically:
- Delete any pervious dev builds.
- Build the app in dev mode.
- Create a copy of the dev build for testing.
- Stop the dev build.
- Build and start a small Go helper server on
localhost:3333
.
This takes care of starting and stopping Bunkr during the tests. - Open the playwright test UI.
❗ This is where you have to take action again and choose which tests to run.
When you're done, you can close the UI and the script will continue. - Stop the helper server.
- Delete the dev build copy.