Closed AugusDogus closed 7 years ago
Hey,
Please see #191.
Thanks
Generally you can check the real error if you do:
ng test -sm=false
instead of
ng test
sm stands for sourcemap
Sometimes even that doesn't work and you need to set a breakpoint just before the exception and execute on the browser console and you receive the real error
the flag -sm=false
is now --source-map=false
Try my solution:
I followed your tutorial on your blog and did not run into any errors, but when trying to replicate the steps in my current project I am.
When trying to setup the most basic test for home.ts
using the basic test laid out on your blog post
I receive the error
Failed: Uncaught (in promise): Error: No provider for UserProvider!
In my attempts to troubleshoot I included the testbed config inline in my test to add UserProvider to the list of providers.
Having done this I now receive the error
Failed: Uncaught (in promise): Error: No provider for DomController!
and so I add that to the list of providers in the same way I did withUserProvider
.Following this I end up with the error
Failed: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'ng:///DynamicTestModule/module.ngfactory.js'.
I've redone these steps with minor differences here and there, but I always end up with the same error at the end. I'm not sure if I should be stubbing/mocking these components or services or if I'm completely off trail.
I'm very new to Angular, Jasmine, and testing in general. Any help offered would be much appreciated.