fix(core): update

This commit is contained in:
2022-02-16 23:28:12 +01:00
parent e5c37b1801
commit 4a299cf3cb
9 changed files with 19060 additions and 3845 deletions

View File

@ -1,11 +1,11 @@
import { expect, tap } from '@pushrocks/tapbundle';
import { expect, expectAsync, tap } from '@pushrocks/tapbundle';
import * as smartnetwork from '../ts/index';
let testSmartNetwork: smartnetwork.SmartNetwork;
tap.test('should create a valid instance of SmartNetwork', async () => {
testSmartNetwork = new smartnetwork.SmartNetwork();
expect(testSmartNetwork).to.be.instanceOf(smartnetwork.SmartNetwork);
expect(testSmartNetwork).toBeInstanceOf(smartnetwork.SmartNetwork);
});
tap.test('should perform a speedtest', async () => {
@ -15,13 +15,13 @@ tap.test('should perform a speedtest', async () => {
});
tap.test('should determine wether a port is free', async () => {
await expect(testSmartNetwork.isLocalPortUnused(8080)).to.eventually.be.true;
await expectAsync(testSmartNetwork.isLocalPortUnused(8080)).toBeTrue();
});
tap.test('should scan a port', async () => {
await expect(testSmartNetwork.isRemotePortAvailable('lossless.com:443')).to.eventually.be.true;
await expect(testSmartNetwork.isRemotePortAvailable('lossless.com', 443)).to.be.eventually.true;
// await expect(testSmartNetwork.isRemotePortAvailable('lossless.com:444')).to.eventually.be.false;
await expectAsync(testSmartNetwork.isRemotePortAvailable('lossless.com:443')).toBeTrue();
await expectAsync(testSmartNetwork.isRemotePortAvailable('lossless.com', 443)).toBeTrue();
await expectAsync(testSmartNetwork.isRemotePortAvailable('lossless.com:444')).toBeFalse();
});
tap.test('should get gateways', async () => {