Project

Contents

Create

We start this tutorial by using our TypeScript starter.

It comes with everything you need to start writing tests with Jest.

If you want to learn how to add Jest to an existing project, read the Testing chapter of the TypeScript Starter documentation.

To create a project for the tutorial, run the following command:

enonic create jest-tutorial -r starter-ts

This will create an app and place it in a folder called jest-tutorial.

TL;DR

If you just want to read the tutorial, but not actually edit any files, you can create a project with the tutorial code already in place.

enonic create myproject -r tutorial-jest

Summary

In the next chapter we will learn how to write a simple test without any mocks.


Contents

Contents