Restore the v2.1.19 application baseline and retain only the focused import preflight summary with duplicate, unavailable, destination, job, and size-limit visibility.
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
const { describe, it, beforeEach, afterEach } = require('node:test');
|
||||
const assert = require('node:assert');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
// Test the module can be required and has the expected API
|
||||
describe('RemoteServer', () => {
|
||||
@@ -41,54 +39,4 @@ describe('RemoteServer', () => {
|
||||
assert.strictEqual(server.getClientCount(), 0);
|
||||
server.stop();
|
||||
});
|
||||
|
||||
it('binds to loopback when no host is supplied', async () => {
|
||||
const RemoteServer = require('../lib/remote-server');
|
||||
const server = new RemoteServer();
|
||||
try {
|
||||
await server.start({
|
||||
port: 0,
|
||||
token: 'test-token-123',
|
||||
onSignalingToCapture: () => {},
|
||||
onCreateCaptureWindow: () => {},
|
||||
onDestroyCaptureWindow: () => {}
|
||||
});
|
||||
assert.strictEqual(server._wss.address().address, '127.0.0.1');
|
||||
} finally {
|
||||
server.stop();
|
||||
}
|
||||
});
|
||||
|
||||
it('keeps the application remote-control listener on loopback', () => {
|
||||
const source = fs.readFileSync(path.join(__dirname, '..', 'main.js'), 'utf8');
|
||||
const start = source.indexOf('async function startRemoteServer()');
|
||||
const end = source.indexOf("ipcMain.on('remote:signaling-from-capture'", start);
|
||||
assert.notStrictEqual(start, -1);
|
||||
assert.notStrictEqual(end, -1);
|
||||
assert.match(source.slice(start, end), /host:\s*'127\.0\.0\.1'/);
|
||||
});
|
||||
|
||||
it('rejects non-object JSON before authentication without throwing', () => {
|
||||
const { EventEmitter } = require('node:events');
|
||||
const RemoteServer = require('../lib/remote-server');
|
||||
const server = new RemoteServer();
|
||||
const socket = new EventEmitter();
|
||||
socket.close = (code) => {
|
||||
socket.closeCode = code;
|
||||
};
|
||||
socket.send = () => {};
|
||||
server._config = {
|
||||
token: 'test-token-123',
|
||||
allowlist: [],
|
||||
diagnosticMode: false,
|
||||
onCreateCaptureWindow: () => {},
|
||||
onDestroyCaptureWindow: () => {},
|
||||
onSignalingToCapture: () => {}
|
||||
};
|
||||
|
||||
server._handleConnection(socket, { socket: { remoteAddress: '127.0.0.1' } });
|
||||
assert.doesNotThrow(() => socket.emit('message', Buffer.from('null')));
|
||||
assert.strictEqual(socket.closeCode, 4002);
|
||||
socket.emit('close');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user