The app scaffolded by Ionic CLI does not include any test setup as of the day of writing this chapter. So, we need to add the required testing setup ourselves.
Setting up the unit testing environment
Setting up the project
To start with, we will create a new folder named chapter9 and copy the todoapp_v2 from chapter8 folder to the chapter9 folder.
Install the dependencies if they are missing by running npm install from the root of the chapter9/todoapp_v2 folder.
Run ionic serve and see if the app is working as expected. When you create, update, and delete a todo, you may see a warning in the console mentioning that the Cordova environment is not present. This is because we are using the local notification plugin inside the browser.
The environment setup we are going...