DEV Community

Discussion on: How To Level Up Your Angular Unit Testing Game (3/3)

Collapse
 
engrmubashir profile image
miq

Great articles, really loved the series :). I need your suggestion with my Angular unit test problem. I have a 'abc.service' which initializes a 'Secondary App' for a remote signup for account creation. When I run the tests it throws error 'Secondary App already exists'. But when I comment that initialization method, everything works fine. How can I solve this problem? I tried the following:

  1. Exclude that 'abc.service' in Karma.config (but does not seem to work)
  2. I am using fdescribe with spec files to run specific tests
  3. This seems an app compilation problem during test run (Karma finds two app initializations)

Please help me out, thanks a lot!

Collapse
 
alisaduncan profile image
Alisa

Hi there! I just saw your comment so hopefully this response isn't too late. Are you testing your 'abc.service' and it has a reference to another service? or something else?