jasmine unit test error when adding Cookie Service

1.5k Views Asked by At

while writing jasmine unit test case for one of my angular 2 component, if I add CookieService in provider list then all remaining other component unit test cases are failing. If I remove CookieService from provider list then test cases are working fine. You can check this at plunker cookiservice unit test.my component spec file code:

import {setBaseTestProviders} from 'angular2/testing';
import {beforeEachProviders,beforeEach,describe,expect,it} from 'angular2/testing';
import {MyComponent} from '../src/my.component';
import {CookieService} from 'angular2-cookie/core';

describe('MyComponent', () => {  
  beforeEach(() => {
    setBaseTestProviders(CookieService);
})  
it('sample test', () => {
       expect('test').toEqual('test');
});    
});
0

There are 0 best solutions below