Testing is one of the most important steps when you develop software applications. At this point, we are ready to start creating components, defining binding behaviors, and configuring our routes. All is okay, but how do we ensure that our components work as expected? We need to test each component before marking it as complete and ready for QA/Production environment.
With Aurelia's component tester, you'll be able to test your component in an isolated way, like on a mini Aurelia application. What to do when testing a component? Evaluate the expected data, and assert a response to data binding and behavior through the life cycle.
First of all, we need to install the aurelia-testing
package:
npm install aurelia-testing
This library is based on Jasmine, the popular BDD JavaScript testing framework that provides the test structure and assertions. If you generated your application with the Aurelia CLI, Jasmine should be included.
Once installed, you can start writing your...