Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Random test failure with Angular 6 and Karma

We have observed random karma test in our CI pipeline. In each run different test fails and sometimes it passes, when it fails this error is thrown:

Uncaught TypeError: params.map is not a function thrown

Has anybody got affected by something similar?

like image 598
michalSolarz Avatar asked Jul 13 '18 07:07

michalSolarz


1 Answers

We have find out that it was caused by other component spec. In this component we are using ActivatedRoute, Router and DialogService (from angularx-bootstrap-modal). It seems that this component couldn't be removed before next test or something like that. Out solution for this error, we are calling

fixture.destroy()

in afterEach in spec that was causing this failure.

like image 138
michalSolarz Avatar answered Nov 16 '22 03:11

michalSolarz