aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/shared/utils/log
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2018-08-29 17:01:32 +0300
committerIttay Stern <ittay.stern@att.com>2019-02-18 18:35:30 +0200
commit6f900cc45d7dd7f97430812b86b5c1d1693c8ae3 (patch)
tree936005c364dc5a7264d6304d4777c3d83494db22 /vid-webpack-master/src/app/shared/utils/log
parent67d99f816cc583643c35193197594cf78d8ce60a (diff)
merge from ecomp a88f0072 - Modern UI
Issue-ID: VID-378 Change-Id: Ibcb23dd27f550cf32ce2fe0239f0f496ae014ff6 Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-webpack-master/src/app/shared/utils/log')
-rw-r--r--vid-webpack-master/src/app/shared/utils/log/log.service.spec.ts46
1 files changed, 42 insertions, 4 deletions
diff --git a/vid-webpack-master/src/app/shared/utils/log/log.service.spec.ts b/vid-webpack-master/src/app/shared/utils/log/log.service.spec.ts
index ea0eb0499..15a840f76 100644
--- a/vid-webpack-master/src/app/shared/utils/log/log.service.spec.ts
+++ b/vid-webpack-master/src/app/shared/utils/log/log.service.spec.ts
@@ -1,16 +1,24 @@
import {LogService} from "./log.service";
+import {TestBed} from "@angular/core/testing";
describe('log service service', () => {
+
let logService : LogService;
- beforeEach(() => {
+ beforeAll(done => (async () => {
+ TestBed.configureTestingModule({
+
+ });
+ await TestBed.compileComponents();
logService = new LogService();
- });
- it('check all ILogger function are defined', ()=>{
+ })().then(done).catch(done.fail));
+
+
+ test('check all ILogger function are defined', ()=>{
expect(logService.log).toBeDefined();
expect(logService.assert).toBeDefined();
expect(logService.error).toBeDefined();
@@ -20,10 +28,40 @@ describe('log service service', () => {
expect(logService.warn).toBeDefined();
});
- it('test getPrefixLog function', ()=> {
+ test('test getPrefixLog function: with data', ()=> {
let args = ['message', [1,2,3,4,5]];
let result = LogService.getPrefixLog(args);
expect(result).toBeDefined();
});
+ test('log assert', ()=> {
+ jest.spyOn(console, 'assert');
+ logService.assert('someArg');
+ expect(console.assert).toHaveBeenCalled();
+ });
+
+ test('log group', ()=> {
+ jest.spyOn(console, 'group');
+ logService.group('someArg');
+ expect(console.group).toHaveBeenCalled();
+ });
+
+ test('log groupEnd', ()=> {
+ jest.spyOn(console, 'groupEnd');
+ logService.groupEnd('someArg');
+ expect(console.groupEnd).toHaveBeenCalled();
+ });
+
+ test('log log', ()=> {
+ jest.spyOn(console, 'log');
+ logService.log('someArg');
+ expect(console.log).toHaveBeenCalled();
+ });
+
+ test('log warn', ()=> {
+ spyOn(console, 'warn');
+ logService.warn('someArg');
+ expect(console.warn).toHaveBeenCalled();
+ });
+
});