import {fakeAsync, TestBed, tick} from '@angular/core/testing'; import { TransactionService } from './transaction.service'; import {HttpClient} from '@angular/common/http'; import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing'; describe('TransactionService', () => { let httpClient: HttpClient; let httpTestingController: HttpTestingController; let service: TransactionService; beforeEach(() => { TestBed.configureTestingModule({ imports: [HttpClientTestingModule] }); httpClient = TestBed.inject(HttpClient); httpTestingController = TestBed.inject(HttpTestingController); service = TestBed.inject(TransactionService); }); it('should be created', () => { expect(service).toBeTruthy(); }); // it('#getUser() should fetch userInfo', fakeAsync(() => { // expect(service.userInfo).toBeUndefined(); // service.getUser('0x9D7c284907acbd4a0cE2dDD0AA69147A921a573D').then( // ); // tick(); // expect(service.userInfo).toBe('Hey'); // })); });