Skip to content

Vue/Jest tests ΒΆ

There are a handful of jest/js tests for some of the Vue pieces in place.

yarn test:unit

will give you output like:

PASS  tests/Javascript/messages_test.spec.js
PASS  tests/Javascript/shift_mixins.spec.js

Test Suites: 2 passed, 2 total
Tests:       4 passed, 4 total
Snapshots:   0 total
Time:        2.726s, estimated 3s
Ran all test suites.

These will also be run as part of github actions immediately before PHP unit tests.

This is using the vue cli test runner, which uses jest, but is not raw jest (I suspect there are a few differences, but don’t know the specifics).

shift_time.spec.js is an example of actually testing the behavior of a Vue2 component. The other tests currently mostly test raw JS functions or methods on the ShiftMixin component.