Browse Source

adding test file

pull/17054/head
Sinan997 3 years ago
committed by Mahmut Gundogdu
parent
commit
5a9a9331bf
  1. 28
      npm/ng-packs/packages/core/src/lib/tests/internet-connection.service.spec.ts

28
npm/ng-packs/packages/core/src/lib/tests/internet-connection.service.spec.ts

@ -0,0 +1,28 @@
import { TestBed } from '@angular/core/testing';
import { InternetConnectionService } from '../services/internet-connection-service';
describe('InternetConnectionService', () => {
let service: InternetConnectionService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(InternetConnectionService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
it('#networkStatus should return real value (true | false)', () => {
expect(typeof service.networkStatus()).toEqual('boolean')
expect(typeof !service.networkStatus()).toEqual('boolean')
});
it('#networkStatus$ should return real value (true | false)', () => {
service.networkStatus$.subscribe(val=>{
expect(typeof val).toEqual('boolean')
expect(typeof !val).toEqual('boolean')
})
});
});
Loading…
Cancel
Save