saskodh / ng-unit-testing-leak

Demo of Angular unit testing memory leaks
9 stars 3 forks source link

Same issue with Karma, Mocha and Jest #1

Open rodoabad opened 8 years ago

rodoabad commented 8 years ago

We have the same issue and the only difference between us is that we use mocha instead of jasmine.

saskodh commented 6 years ago

Hi @rodoabad, thanks for sharing this. I updated the example with Jest and there is also the same issue. The test run with Jest w/ jsdom also crashes on memory: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory.

These are the results when the proposed solution is applied:


Jest w/ jsdom execution - w/o mem. leaks
    Tests:       3008 passed, 3008 total
    Snapshots:   0 total
    Time:        42.487s
    Ran all test suites.

Karma w/ Chrome execution - w/o mem. leaks
    All 3008 tests passed - 28s 495ms```