Setting up Cypress & Jest in an Ionic/Angular Project
Getting our application ready
PROModule Outline
- Source Code & Resources PRO
- Lesson 1: Introduction PUBLIC
- Lesson 2: Introduction to Test Driven Development PUBLIC
- Lesson 3: Testing Concepts PUBLIC
- Lesson 4: Jest and Cypress PRO
- Lesson 5: A Simple Unit Test PRO
- Lesson 6: A Simple E2E Test PRO
- Lesson 7: Introduction to Angular's TestBed PRO
- Lesson 8: Setting up Tests with Jest and Cypress PUBLIC
- Lesson 9: Test Development Cycle PRO
- Lesson 10: Setting up Cypress & Jest in an Ionic/Angular Project PRO
- Lesson 11: The First Tests PRO
- Lesson 12: Injected Dependencies & Spying on Function Calls PRO
- Lesson 13: Building out Core Functionality PRO
- Lesson 14: Testing Asynchronous Code PRO
- Lesson 15: Creating a Mock Backend PRO
- Lesson 16: Setting up the Server PRO
- Lesson 17: Testing Integration with a Server PRO
- Lesson 18: Testing Storage and Reauthentication PRO
- Lesson 19: Refactoring with Confidence PRO
- Lesson 20: Conclusion PRO
Lesson Outline
Getting Ready
We have discussed quite a few testing concepts already, and we have covered some of the basics. But, there's only so much we can cover without actually doing it for ourselves (otherwise this knowledge will probably just drop straight back out of your head).
We are going to start walking through a practical example of using Test Driven Development to build out a real-world application. There are still a few concepts that we haven't covered yet that we will need to learn, but we will cover those as they become relevant in the tests we are building. Having the appropriate context for the situations you will need to use these concepts in will do a great deal to help with learning.
We will be using Test Driven Development to build a simplified version of the application used to power the original version of the Elite Ionic course (when Elite Ionic was just a course and not an entire website). The entire application is far too broad in scope to fit into this module, but we will be focusing on the interesting bits and keeping it realistic (I don't want this to be a "how to test a simple todo app" type of situation, because there are important testing scenarios that you just won't hit with that type of application).
We will use the test development cycle we discussed in the last lesson to build out the entire application, which means we will:
- Write an End-to-End test to describe the behaviour we want to implement
- Write unit tests that would satisfy the requirements of the E2E test
- Write code to satisfy the unit tests
- Repeat
For the rest of this module, we will spend each lesson going through the process above - starting with an E2E test, implementing unit tests, and satisfying those tests with our applications code. When we run into a situation where we need to understand a new concept to implement a test, we will spend some time talking through that.
Create a New Project with Tests
We are just going to create a fresh new Ionic project, which will have tests set up by default.
Thanks for checking out the preview of this lesson!
You do not have the appropriate membership to view the full lesson. If you would like full access to this module you can view membership options (or log in if you are already have an appropriate membership).