Member-only story
If you like this text and are interested in more, follow me on Twitter or Linkedin and stay updated with my new posts.
A question often asked in the interviews is: do you do any testing of your UI applications? And the expected answer is yes. But what kind of testing can you do for the UI applications? In this post, I am giving a top level of the four different types of testing.
Unit testing
The first and most basic type of testing is unit testing. You do this by taking a small piece of functionality and testing it independently from the rest of the system. One function, for example. Most often, you would test services this way. You pass the required parameters to the function and checking if the output is what you expect. There are few more things you might want to test with the unit tests. You could use spies for checking that your code runs some function, how many times, and with which parameters. When talking about unit tests, you can’t skip mocks. As said before, unit tests only test one piece of functionality. But what if that functionality uses some other service. With mocks, you can “fake” the response of that other service. A popular library for this kind of test is Chai.
E2E testing
The following most popular tests with the UI applications are end-to-end tests, or E2E for short. With…