loading...

Migrate your Angular library to Jest

kreuzerk profile image kreuzerk Originally published at blog.angularindepth.com on ・1 min read

A step by step guide on how to migrate a multi-project Angular workspace to Jest

By default, the Angular CLI generates new Angular projects with Karma as a testing framework and Jasmine as an assertion library.

However, today, many people move away from this default stack and start to use Jest.

Jest is a testing framework created by Facebook, which continually gains steam. It’s super popular in the React world, and it now also starts to boom in the Angular world.

What are we going to learn πŸ‘¨β€πŸŽ“

The Angular CLI sets up Karma with Jasmine. If you want to use Jest instead, you can either use the jest-schematics for normal SPAs or you need some manual setup, which is required for multi-project workspaces.

This blog post is a step by step guidance on how to generate or migrate an Angular library project (which is a multi-project workspace) to Jest.

☝ The Jest setup described in this blogpost works with Angular 8+, Jest 24+ and jest-preset-angular 8+.

Find out more...

Posted on by:

kreuzerk profile

kreuzerk

@kreuzerk

Passionate Frontend developer - always try to learn, improve and share knowledge

Discussion

markdown guide