Good afternoon every one! I know some of you are from the QA team, today I am going to present an interesting topic to you. There are lots of testing frameworks; recently there is a new one named Jest, which gets popular in a very short period of time. There are three features, which make Jest outstanding:
- It supports React out of the box.
- It supports watch mode.
- It supports snapshot testing.
React is the most popular JS framework. More and more frontend developers are learning and adopting React. So it is essential for a testing framework to support React. Jest supports React out of the box. This is mainly because both React and Jest are from the same company: Facebook.
Jest supports watch mode. For very big projects, there might thousands of test files besides thousands of source code files. It might take minutes or even hours to run all of then testing cases. Since it’s very expensive to run all of the test cases, it is essential to have the ability to only run those related to changed files.
The last feature is very innovative: snapshot testing. According to statistics, most of the times we care about what have changed and how they changed. Snapshot testing was born to serve the purpose. It captures and compares snapshots so you can analyze how state changes over time.
OK, that concludes my presentation. Let restate the three outstanding features of Jest: it works with React very well without extra efforts, it supports watch mode to speed up the testing, and it also supports snapshot testing to monitor state changes.
Any questions? Thank you for your attention and enjoy testing!