Closed CoreyCole closed 3 years ago
I'm also getting a very mysterious "script error thrown" when running my tests and it's because I'm not providing a sufficient stub. Similar to the error seen here: https://stackoverflow.com/questions/49731617/jasmine-3-errors-in-angular-5-2-tests/50181944
This is more motivation to provide a testing module.
I'm considering a change where we support @firebase/testing
in the future but in the meantime we have local emulators now, which make testing a lot easier. Closing this issue as stale for now, but keep an eye on future releases.
I've added angularfire to my project for authentication. I have an AuthService that handles everything to do with firebase in my application. I'm having trouble getting tests to pass. I've looked at #18 and #1706. Following guidance from these issues, this is what I've tried to do in my
auth-service.spec.ts
:This gets the tests passing for my
AuthService
, but every component/service spec that imports AuthService are failing even though I only import AngularFireAuth inside the AuthService itself. Do I need to do this stubbing in each spec file?I would really love to have some sort of
AngularFireTestingModule
that I could import instead of this stub stuff that has been suggested. Similar toRouterTestingModule
andHttpClientTestingModule
Has something like this been discussed?