feat(smartnetwork): add Rust-powered network diagnostics bridge and IP intelligence lookups

This commit is contained in:
2026-03-26 15:24:43 +00:00
parent e9dcd45acd
commit c3ac9b4f9e
34 changed files with 5499 additions and 3159 deletions

View File

@@ -8,6 +8,10 @@ tap.test('should create a valid instance of SmartNetwork', async () => {
expect(testSmartNetwork).toBeInstanceOf(smartnetwork.SmartNetwork);
});
tap.test('should start the Rust bridge', async () => {
await testSmartNetwork.start();
});
tap.test('should perform a speedtest', async () => {
const result = await testSmartNetwork.getSpeed();
console.log(`Download speed for this instance is ${result.downloadSpeed}`);
@@ -19,8 +23,9 @@ tap.test('should perform a speedtest', async () => {
expect(parseFloat(result.uploadSpeed)).toBeGreaterThan(0);
});
tap.test('should determine wether a port is free', async () => {
await expect(testSmartNetwork.isLocalPortUnused(8080)).resolves.toBeTrue();
tap.test('should determine whether a port is free', async () => {
// Use a high-numbered port that's unlikely to be in use
await expect(testSmartNetwork.isLocalPortUnused(59123)).resolves.toBeTrue();
});
tap.test('should scan a port', async () => {
@@ -54,4 +59,8 @@ tap.test('should get public ips', async () => {
expect(ips).toHaveProperty('v6');
});
tap.start();
tap.test('should stop the Rust bridge', async () => {
await testSmartNetwork.stop();
});
export default tap.start();