smartnetwork/test/test.ping.ts

19 lines
654 B
TypeScript
Raw Normal View History

2022-02-16 23:18:23 +00:00
import { tap, expect, expectAsync } from '@pushrocks/tapbundle';
2022-02-16 23:03:13 +00:00
import * as smartnetwork from '../ts';
let testSmartnetwork: smartnetwork.SmartNetwork;
tap.test('should create a vlid instance of SmartNetwork', async () => {
testSmartnetwork = new smartnetwork.SmartNetwork();
expect(testSmartnetwork).toBeInstanceOf(smartnetwork.SmartNetwork);
2022-02-16 23:18:23 +00:00
});
2022-02-16 23:03:13 +00:00
tap.test('should send a ping to Google', async () => {
expectAsync(testSmartnetwork.ping('https://lossless.com')).toBeTrue();
2022-02-16 23:33:11 +00:00
expectAsync(testSmartnetwork.ping('https://notthere.lossless.com')).toBeTrue();
expectAsync(testSmartnetwork.ping('192.168.186.999')).toBeFalse();
2022-02-16 23:18:23 +00:00
});
2022-02-16 23:03:13 +00:00
tap.start();