Files

21 lines
597 B
TypeScript
Raw Permalink Normal View History

import { expect, tap } from '@git.zone/tstest/tapbundle';
2022-10-20 08:24:20 +02:00
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('127.0.0.1', 1);
expect(result.alive).toBeTrue();
});
2022-10-21 12:06:24 +02:00
2022-10-21 11:55:42 +02:00
tap.test('should detect alive', async () => {
expect(await testPing.pingAlive('127.0.0.1', 1)).toBeTrue();
});
2022-10-21 11:55:42 +02:00
export default tap.start();