Does Angular's DestroyAfterEach option affect the speed of Jest tests?

Viewed 377

DestroyAfterEach is a new option that was added in Angular 12.1, and promises to greatly speed up test performance (details here). However, when making this change, I am not noticing any speed difference. I suspect this may be because I'm using Jest, which does not involve a browser.

Is it expected that Jest does not have any speed improvements when applying this option? It's also possible I'm applying the option incorrectly.

1 Answers

It does indeed change the speed. Have just checked it on our project (Angular 13.3.2, Karma 6.3.9, Jasmine-core 3.10.1). To compile and finish the tests it takes 45 seconds from the moment of running npm run test command with destroyAfterEach: true and 67 seconds with destroyAfterEach: false.

SUMMARY: √ 1154 tests completed i 3 tests skipped TOTAL: 1154 SUCCESS

Related