From a5a7e4cb231c90272fa2dac89e94b5c445f8ce34 Mon Sep 17 00:00:00 2001 From: Merge Sim Date: Sun, 6 Sep 2026 01:43:13 -0700 Subject: [PATCH] test(packaging): cover the missing packaged main entry assertion The required-file check had no test, so the refactor that split it out of the scanning loop could have dropped it silently. Removing the assertion now fails this case. --- ...electron-builder-runtime-resources.test.mjs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/config/scripts/electron-builder-runtime-resources.test.mjs b/config/scripts/electron-builder-runtime-resources.test.mjs index ffc6d1ac106..99fd8e5bc9b 100644 --- a/config/scripts/electron-builder-runtime-resources.test.mjs +++ b/config/scripts/electron-builder-runtime-resources.test.mjs @@ -71,6 +71,24 @@ describe('packaged runtime resources', () => { } }) + it('still fails when a required packaged main entry is missing entirely', async () => { + const resourcesDir = await mkdtemp(join(tmpdir(), 'orca-runtime-missing-entry-')) + try { + await writeFile(join(resourcesDir, 'app.asar'), '', 'utf8') + + const asar = { + listPackage: () => ['/out/main/index.js'], + extractFile: () => Buffer.from('', 'utf8') + } + + expect(() => verifyPackagedMainRuntimeDeps(resourcesDir, asar)).toThrow( + /managed-agent-hook-controls\.js was not found/ + ) + } finally { + await rm(resourcesDir, { recursive: true, force: true }) + } + }) + it('verifies bare imports that rolldown hoisted into a shared main chunk', async () => { const resourcesDir = await mkdtemp(join(tmpdir(), 'orca-runtime-chunk-imports-')) try {