KON-340 FE Testabdeckung im Sonarcube nach Analyse (-> KON-339) erhöhen
diff --git a/package.json b/package.json index d7fa271..50d6495 100644 --- a/package.json +++ b/package.json
@@ -1,15 +1,15 @@ { "name": "openkonsequenz-contact-base-data-2019", "version": "1.0.0", - "description": "Contact Base Datad", + "description": "Contact Base Data", "license": "MIT", "author": "Martin Gardyan <martin.gardyan@pta.de>", "angular-cli": {}, "scripts": { - "start": "npm run sy-pre-start & ng serve --proxy-config proxy.conf.json", - "start-integration": "npm run sy-pre-start & ng serve --proxy-config proxy.conf-integration.json", + "start": "npm run sy-pre-start && ng serve --proxy-config proxy.conf.json", + "start-integration": "npm run sy-pre-start && ng serve --proxy-config proxy.conf-integration.json", "lint": "ng lint", - "test": "npm run sy-pre-test & ng test", + "test": "npm run sy-pre-test && ng test", "pree2e": "webdriver-manager update --standalone false --gecko false", "e2e": "ng e2e", "sy-pre-test": "node hooks/pre-test.js", @@ -17,8 +17,8 @@ "sy-pre-build": "node hooks/pre-build.js", "sy-post-build": "node hooks/post-build.js", "sw": "sw-precache --root=./dist --config=sw-precache-config.js", - "sy-build": "npm run sy-pre-build & ng build --prod --aot & npm run sy-post-build & npm run sw", - "start-in-docker": "npm run sy-pre-start & ng serve --optimization=false --vendor-chunk --common-chunk --host=0.0.0.0 --disableHostCheck=true --proxy-config proxy-docker.conf.json" + "sy-build": "npm run sy-pre-build && ng build --prod --aot && npm run sy-post-build && npm run sw", + "start-in-docker": "npm run sy-pre-start && ng serve --optimization=false --vendor-chunk --common-chunk --host=0.0.0.0 --disableHostCheck=true --proxy-config proxy-docker.conf.json" }, "private": true, "dependencies": {
diff --git a/src/app/shared/asyncServices/http/http.adapter.spec.ts b/src/app/shared/asyncServices/http/http.adapter.spec.ts new file mode 100644 index 0000000..f2a301a --- /dev/null +++ b/src/app/shared/asyncServices/http/http.adapter.spec.ts
@@ -0,0 +1,53 @@ + /******************************************************************************** + * Copyright (c) 2020 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + ********************************************************************************/ +/* import { async, TestBed } from '@angular/core/testing'; +import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; +import { ConfigService } from '@app/app-config.service'; +import { of } from 'rxjs/observable/of'; +import { HttpAdapter } from './http.adapter'; +import { Response } from '@angular/http'; + +describe('HttpAdapter', () => { + + + let responseHandlerMock: any; + let httpMock: any; + let configserviceMock: any; + + beforeEach(() => { + + + }); + + it('should call getBaseUrl', () => { + const spy1 = spyOn(configserviceMock, 'get').and.callThrough(); + (httpService as any).getBaseUrl(); + expect(spy1).toHaveBeenCalled(); + }); + + it('should call getDefaultHeaders', () => { + const spy1 = spyOn((httpService as any), 'getDefaultHeaders').and.callThrough(); + let response = (httpService as any).getDefaultHeaders(); + expect(response).toBeNull(); + expect(spy1).toHaveBeenCalled(); + }); + + it('should call getDefaultHeaders', () => { + const observableRes = of( {} as any ); + const spy1 = spyOn((httpService as any), 'responseInterceptor').and.callThrough(); + const spy2 = spyOn(HttpAdapter, 'baseAdapter'); + let observable = (httpService as any).responseInterceptor(observableRes); + expect(spy1).toHaveBeenCalled(); + }); + +}); */