i am trying to setup unit tests using inject. But i am not sure how to set the parameters.
The constructor for the class being tested (auth.service.ts) is:
constructor(private http : HttpClient, private token: TokenStorage) {}
Unit Test class (auth.service.spec.ts)
import { TestBed, inject } from '@angular/core/testing';
import { AuthService } from './auth.service';
import { HttpClient, HttpHandler, HttpClientModule } from '@angular/common/http';
import { TokenStorage } from './token.storage';
describe('AuthService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [AuthService, HttpClient, HttpHandler, HttpClientModule, TokenStorage]
});
});
it('should be created', inject([AuthService], (service: AuthService) => {
expect(service).toBeTruthy();
}));
});