4

I am working on an Angular frontend unit test for updating the Sonar report,

Chrome Headless 93.0.4577.63 (Windows 10) ERROR
  An error was thrown in afterAll
  createSpyObj requires a non-empty array or object of method names to create spies for thrown
Chrome Headless 93.0.4577.63 (Windows 10): Executed 994 of 1041 (skipped 20) ERROR (0 secs / 11.047 secs)
Chrome Headless 93.0.4577.63 (Windows 10) ERROR
  An error was thrown in afterAll
Chrome Headless 93.0.4577.63 (Windows 10): Executed 994 of 1041 (skipped 20) ERROR (16.566 secs / 11.047 secs)

This is the error log I am getting. Previously all the tests ran without any problem. After a few new tests were added in a different component suddenly this error popped up. Then I removed the new tests and the new component also. But I am still getting this error. But the tests are executing without any error on the Chrome headless browser that automatically opens. Why am I getting this ERROR

1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Sep 15, 2021 at 7:03

1 Answer 1

4

Look through the code base for jasmine.createSpyObj and ensure that the array is not empty.

// Make sure you don't see empty arrays like so when using jasmine.createSpyObj
// The array is supposed to be an array of strings of public methods
// you want to mock.

jasmine.createSpyObj([]);
jasmine.createSpyObj('SomeName', []);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.