import { tap, expect } from '@pushrocks/tapbundle'; import * as webdetector from '../ts/index.js'; let testWebDetector: webdetector.WebDetector; tap.test('first test', async () => { testWebDetector = new webdetector.WebDetector({ checkOnlineUrl: 'https://pubapi.lossless.one', }); expect(testWebDetector).toBeInstanceOf(webdetector.WebDetector); }); tap.test('should be online', async () => { const onlineResultBoolean = await testWebDetector.isOnline(); console.log('browser is online:'); console.log(onlineResultBoolean); testWebDetector.startPeriodicChecks(); testWebDetector.onlineObservable.subscribe((state) => { console.log(state); }); testWebDetector.stopPeriodicChecks(); }); tap.test('should detect the platform', async () => { const platform = testWebDetector.platform.detectPlatform(); console.log(platform); }); console.log('hi'); tap.start();