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.
This commit is contained in:
Merge Sim
2026-09-06 01:43:13 -07:00
parent da33dda26a
commit a5a7e4cb23
@@ -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 {