Files
Multi-Hoster-Upload/tests/remote-server.test.js
T
Sucukdeluxe b7754f355b release: v2.1.17
Render upload progress from fractional transfer values while keeping the visible percentage rounded. Move the green fill with a linear compositor transform and cover the 92-to-93 percent transition with monotonic frame-level Electron assertions.

Keep Electron UI verification listeners loopback-only so development validation no longer raises a Windows Firewall prompt under electron.exe. Extend the public source allowlist with the focused network safety regression coverage.
2026-08-13 04:37:18 +02:00

43 lines
1.4 KiB
JavaScript

const { describe, it, beforeEach, afterEach } = require('node:test');
const assert = require('node:assert');
// Test the module can be required and has the expected API
describe('RemoteServer', () => {
it('should export a class with start/stop methods', () => {
const RemoteServer = require('../lib/remote-server');
assert.strictEqual(typeof RemoteServer, 'function');
assert.strictEqual(typeof RemoteServer.prototype.start, 'function');
assert.strictEqual(typeof RemoteServer.prototype.stop, 'function');
assert.strictEqual(typeof RemoteServer.prototype.getClientCount, 'function');
});
it('should start and stop without errors', async () => {
const RemoteServer = require('../lib/remote-server');
const server = new RemoteServer();
// Mock mainWindow
const mockMainWindow = {
isDestroyed: () => false,
getTitle: () => 'Test Window',
getContentBounds: () => ({ x: 0, y: 0, width: 1920, height: 1080 }),
webContents: {
sendInputEvent: () => {}
}
};
await server.start({
port: 0, // random available port
host: '127.0.0.1',
token: 'test-token-123',
allowInput: true,
mainWindow: mockMainWindow,
onSignalingToCapture: () => {},
onCreateCaptureWindow: () => {},
onDestroyCaptureWindow: () => {}
});
assert.strictEqual(server.getClientCount(), 0);
server.stop();
});
});