To run tests in standalone mode for an existing Joystick app, from your terminal, run:
joystick test
This will start a mirror of your app on port 1977
and run all of your app's tests against it.
Watch Mode
Joystick has two options for running your tests in watch mode:
- As a traditional, standalone process (in another terminal) that watches for app changes and reruns your tests as normal.
- As an integrated process that runs your app's tests and reports their results directly inside of your app's server logs.
Traditional Watch Mode
To run your tests in traditional watch mode, run:
joystick test --watch
This will start a separate process that runs your tests and reruns them whenever file changes are detected.
Integrated Watch Mode
Joystick's integrated watch mode is designed to run directly alongside your Joystick app.
This makes it far easier to do TDD with Joystick and encourages better testing practices as your test results are output right alongside your dev server's logs (no need to maintain multiple terminals just to do TDD).
In order to run tests in integrated watch mode, just start your app with the --tests
flag:
joystick start --tests
This will start a mirror of your app on port 1977
and run all of your app's tests against it at startup time and then again whenever your app's source changes.