Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding any tests to app.component.spec.ts (even empty ones) causes other tests to fail #17

Open
lathonez opened this issue Mar 29, 2017 · 0 comments

Comments

@lathonez
Copy link
Contributor

After migrating from @angular/cli to this testing setup, two of my tests started failing. Both of these tests are long standing and have not been modified in ages.

I tried re-writing one of the tests using the latest recommendations on Stack Overflow, to no avail.

To cut a very long story short, I figured out that commenting out the tests in app.component.spec.ts let the tests run fine.

I also tried empty tests (nothing in the test block at all), as well as adding an afterEach() => destroy, which didn't help.

To Replicate:

  • git clone [email protected]:lathonez/clicker.git
  • cd clicker
  • npm install
  • uncomment the tests in app.component.spec.ts
  • npm test

Note

I do not expect a solution to this problem, but I consider leaving the repo in it's current state (as long as we are unable to explain the behaviour) pretty dangerous in terms of other user's time. There is nothing at all to make you think that these tests would be affected by app.component.spec.ts, indeed everything we know about the unit testing setup tells us otherwise. You can easily sink several hours into this problem before coming to this point, or just getting frustrated and binning your perfectly valid tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant