My app is running fine, but I cannot get my tests to pass with Firebase.
Error: No provider for Token FirebaseAppName!
Here is me spec:
import { TestBed, inject } from '@angular/core/testing';
import { ApiService } from './api.service';
import { HttpModule } from '@angular/http';
import {FIREBASE_PROVIDERS, defaultFirebase, AngularFire} from 'angularfire2';
describe('ApiService', () => {
beforeEach(() => {
const firebaseConfig = {
apiKey: "foo",
authDomain: "bar",
databaseURL: "baz",
storageBucket: "foo",
messagingSenderId: "bar"
}
TestBed.configureTestingModule({
// providers: [ApiService, defaultFirebase(firebaseConfig)],
providers: [ApiService, FIREBASE_PROVIDERS, defaultFirebase(firebaseConfig)],
imports: [
HttpModule
]
});
});
it('should ...', inject([ApiService], (service: ApiService) => {
expect(service).toBeTruthy();
}));
});
Thanks in advance.
Versions:
"@angular/core": "^2.4.0",
"jasmine-core": "~2.5.2",
"firebase": "^3.7.0",