Files
BetterDesk/web-nodejs/tests/updateService.agentRebuild.test.js
T
UNITRONIX 5de22d8ce6 Enhance agent source management and update process
- Added functionality to track the remote SHA of the agent source, improving consistency during updates.
- Implemented a new method to sync the full support-agent source from GitHub, ensuring all necessary files are staged for rebuilds.
- Introduced a mechanism to check for agent source drift, allowing for automatic repairs when discrepancies are detected.
- Updated the update service to trigger agent source synchronization and rebuilds based on specific file changes, streamlining the update workflow.
2026-06-04 03:18:28 +02:00

34 lines
997 B
JavaScript

'use strict';
const test = require('node:test');
const assert = require('node:assert/strict');
const updateService = require('../services/updateService');
test('shouldQueueAgentRebuild triggers on support-agent source changes', () => {
const data = {
grouped: {
supportAgent: [{ path: 'betterdesk-support-agent/urls.go' }],
},
};
assert.equal(updateService.shouldQueueAgentRebuild(data), true);
});
test('shouldQueueAgentRebuild triggers on build worker-only commits', () => {
const data = {
grouped: {
console: [{ path: 'web-nodejs/services/agentBuildWorker.js' }],
},
};
assert.equal(updateService.shouldQueueAgentRebuild(data), true);
});
test('shouldQueueAgentRebuild ignores unrelated console changes', () => {
const data = {
grouped: {
console: [{ path: 'web-nodejs/views/settings.ejs' }],
},
};
assert.equal(updateService.shouldQueueAgentRebuild(data), false);
});