Add runtime version reporting and display
This commit is contained in:
@@ -103,6 +103,10 @@ test('GET and domain mutations return one state shape with monotonic revisions',
|
||||
const singboxPath = path.join(binDir, 'sing-box');
|
||||
const workingSingbox = `#!/usr/bin/env node
|
||||
if (process.argv[2] === 'check') process.exit(0);
|
||||
if (process.argv[2] === 'version') {
|
||||
console.log('sing-box version 1.12.13');
|
||||
process.exit(0);
|
||||
}
|
||||
process.on('SIGTERM', () => process.exit(0));
|
||||
setInterval(() => {}, 60_000);
|
||||
`;
|
||||
@@ -155,6 +159,13 @@ setInterval(() => {}, 60_000);
|
||||
});
|
||||
|
||||
const initial = await waitForState(port, child, () => stderr);
|
||||
const version = await request(port, '/api/version');
|
||||
assert.deepEqual(version, {
|
||||
apiVersion: 1,
|
||||
location: 'mac',
|
||||
components: { macClient: '0.1.0' },
|
||||
runtime: { singBox: '1.12.13' },
|
||||
});
|
||||
assertStateSnapshot(initial);
|
||||
assert.equal(initial.selection.appliedServerId, 'test-vpn');
|
||||
assert.equal(JSON.stringify(initial).includes(subscriptionUrl), false);
|
||||
|
||||
Reference in New Issue
Block a user