Migrate from Karma Jasmine to Jest in Angular 10

Migrate from Karma Jasmine to Jest in Angular 10

JS Frameworks

3 года назад

4,093 Просмотров

A step by step guide to integrate the Jest test framework to an Angular 10 typescript project using vscode . Here we easily migrate a fresh Angular 10 project using Karma jasmine to jest within 10 minutes.

0:00 - Introduction
0:06 - Migration of Karma Jasmine to Jest
10:38 - Jest watch mode
11:30 - Debugging jest unit test with VSCode
13:30 - Debugging jest unit test with Chrome

Sample github starter repo:
https://github.com/anuroopjoy/jest-angular

Тэги:

#angular_jest #angular_jest_vs_karma #angular_jest_vs_jasmine #angular_jest_testing_tutorial #angular_jest_testing #angular_jest_setup #angular_jest_tutorial #jest_angular_tutorial #jest_angular_test #jest_angular_unit_test #jest_angular #angular_testing #angular_jest_unit_testing #Angular_jest_unit_test_example #Angular_10
Ссылки и html тэги не поддерживаются


Комментарии:

Christopher Adolphe
Christopher Adolphe - 07.03.2021 07:29

Thanks for sharing. I was struggling with the "Unexpected token" error when doing this migration in my project. If I may add, a deprecation warning appears in the console with the configuration shown in the video. To get rid of it, just use the import 'jest-preset-angular/setup-jest' instead of 'jest-preset-angular' in the setupJest.ts file

Ответить
Kalikkalam
Kalikkalam - 18.07.2022 18:41

anna poli thenks

Ответить
parvathy havaji
parvathy havaji - 13.01.2022 15:06

This was really helpful. Thank you.

Ответить
canet
canet - 23.06.2021 18:53

Thank you for that video. After I've migrated to jest I got this error in every test that does TestBed.configureTestingModule(). compileComponents().

zone-testing.js is needed for the fakeAsync() test helper but could not be found.
Please make sure that your environment includes zone.js/dist/zone-testing.js.

Do you have any ideas how can I fix it?

Ответить
Nagendra
Nagendra - 30.05.2021 13:01

Awesome..this is working

Ответить
Yo daily internet
Yo daily internet - 14.05.2021 20:16

Thanks , nice content :-)

Ответить
Akhil K
Akhil K - 17.01.2021 16:21

Loving these frequent uploads!

Ответить