Enonic proudly presents new tutorial for helping Enonic XP developers write tests (in Typescript or Javascript) using Jest framework and our very own Mock XP library.
The tutorial assumes that you are using the tutorial’s repository (tutorial-intro) which has all the prerequisites for the build.
If you want to migrate the tutorial’s setup to your own app then you have to make sure your app is set up to be built in exactly the same way as the tutorial’s repository, for example you have to install tsup, copy over “tsup” folder from the tutorial repository, make sure you are using exactly the same paths etc. Which you don’t necessarily have to do.
I suggest you go through the tutorial first to understand the concept of creating tests for XP apps. This will help you create tests in your own app without having to replicate the build setup from the tutorial.
We will discuss adding a new chapter which explains how to configure test runs in an existing app.