...
Step 11: Add a unit test with Jest
As part of our new framework we have introduced Jest to allow us to write JavaScript unit tests. All components are required to have a test file with coverage for all emitted events, all methods and a snapshot. We are going to create our test file Ping.spec.js in the following directory client/component/local_quickstart/src/tests/unit/pages/.
The test below currently just creates a snapshot which allows us to easily track changes.
client/component/local_quickstart/src/tests/unit/pages/Ping.spec.js
...
language | js |
---|
...
Please see our documentation on testing frontend code here.
To run the tests we run the following the command:
...