Files
smartping/test/test.ts

21 lines
592 B
TypeScript
Raw Normal View History

2022-10-20 08:24:20 +02:00
import { expect, expectAsync, tap } from '@pushrocks/tapbundle';
import * as smartping from '../ts/index.js';
2018-11-18 15:06:17 +01:00
2022-10-21 11:55:42 +02: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 08:24:20 +02:00
});
2018-11-18 15:06:17 +01:00
2022-10-21 12:06:24 +02:00
tap.test('should deliver a ping result', async () => {
const result = await testPing.ping('lossless.com', 1000);
console.log(result);
})
2022-10-21 11:55:42 +02:00
tap.test('should detect alive', async () => {
await expectAsync(testPing.pingAlive('lossless.com', 1000)).toBeTrue();
})
2022-10-20 08:24:20 +02:00
tap.start();