commit bdaeed1f5f3c7952428ab565f4c2f25aee8a7b14
parent 4e22a08b855adb1e5f380c84c00890ca13fe0fcb
Author: MTRNord <mtrnord1@gmail.com>
Date: Sun, 20 May 2018 12:22:13 +0200
Add the most simple apiService unit test to let the tests succeed
Diffstat:
1 file changed, 22 insertions(+), 0 deletions(-)
diff --git a/src/app/api.service.spec.ts b/src/app/api.service.spec.ts
@@ -0,0 +1,22 @@
+import { TestBed, inject } from '@angular/core/testing';
+
+import { ApiService } from './api.service';
+import {HttpClientTestingModule} from '@angular/common/http/testing';
+import {HttpClientModule} from '@angular/common/http';
+
+describe('ApiService', () => {
+ beforeEach(() => {
+ TestBed.configureTestingModule({
+ providers: [ApiService],
+ imports: [
+ // no more boilerplate code w/ custom providers needed :-)
+ HttpClientModule,
+ HttpClientTestingModule
+ ]
+ });
+ });
+
+ it('should be created', inject([ApiService], (service: ApiService) => {
+ expect(service).toBeTruthy();
+ }));
+});