Add AV/Defender tests for diagnostics, exclusions, and defender_off.

Vitest covers mining diagnostics JSON blockers, AV-Safe preset fields, Calibrate .ps1 generation, and Settings Defender UI; Go tests cover defender_off error paths and mining blocker inference.
This commit is contained in:
AetherForge
2026-06-07 06:38:00 -07:00
parent de10718505
commit b5b1de4517
9 changed files with 247 additions and 2 deletions

View File

@@ -23,4 +23,26 @@ describe('defenderExclusion', () => {
it('provides default install preview', () => {
expect(defaultWindowsInstallPreview('rig-01')).toContain('rig-01');
});
it('warns when not elevated and documents manual checklist', () => {
const script = buildDefenderExclusionScript({
installPath: '%LOCALAPPDATA%\\CryptoMiner\\worker',
processName: 'RuntimeBrokerHelper',
});
expect(script).toContain('Administrator');
expect(script).toContain('Add-MpPreference -ExclusionPath');
expect(script).toContain('Add-MpPreference -ExclusionProcess');
expect(script).toContain('Controlled folder access');
expect(script).toContain('Cloud-delivered protection');
expect(script).toMatch(/AetherForge — Windows Defender exclusions/);
});
it('appends .exe to bare process names', () => {
const script = buildDefenderExclusionScript({
installPath: 'C:\\miner',
processName: 'worker',
});
expect(script).toContain("'worker.exe'");
expect(script).not.toContain("'worker.exe.exe'");
});
});