smartping/test/test.ts

21 lines
592 B
TypeScript
Raw Permalink Normal View History

2022-10-20 06:24:20 +00:00
import { expect, expectAsync, tap } from '@pushrocks/tapbundle';
import * as smartping from '../ts/index.js';
2018-11-18 14:06:17 +00:00
2022-10-21 09:55:42 +00:00
let testPing: smartping.Smartping;
tap.test('should create an instance of Smartping', async () => {
testPing = new smartping.Smartping();
expect(testPing).toBeInstanceOf(smartping.Smartping);
2022-10-20 06:24:20 +00:00
});
2018-11-18 14:06:17 +00:00
2022-10-21 10:06:24 +00:00
tap.test('should deliver a ping result', async () => {
const result = await testPing.ping('lossless.com', 1000);
console.log(result);
})
2022-10-21 09:55:42 +00:00
tap.test('should detect alive', async () => {
await expectAsync(testPing.pingAlive('lossless.com', 1000)).toBeTrue();
})
2022-10-20 06:24:20 +00:00
tap.start();