From 8cc9599ab26ebb6737953a639324fc4e6efe353f Mon Sep 17 00:00:00 2001 From: 1bcMax Date: Tue, 20 Oct 2026 00:08:12 -0500 Subject: [PATCH] test(scanner): find OpenClaw's scanner in .mjs chunks openclaw 2026.10.x moved its dist chunks from .js to .mjs, so the scanner test (which only matched scanner-*.js) found nothing and failed with "scanner chunk not found" on Dependabot #486. Accept both extensions. Verified locally against openclaw 2026.10.4 and the current pin: 2 passed. --- test/integration/security-scanner.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/integration/security-scanner.test.ts b/test/integration/security-scanner.test.ts index 6b924b8f..fe17b03f 100644 --- a/test/integration/security-scanner.test.ts +++ b/test/integration/security-scanner.test.ts @@ -76,11 +76,14 @@ describe("OpenClaw security scanner", () => { // chunks ship — one minified with mangled exports and one with proper names — // so match both prefixes, iterate all, and pick the one exporting // scanDirectoryWithSummary; fall back to "first function export" for older builds. + // 2026.10.x also moved its dist chunks from `.js` to `.mjs`, so accept both. const openclawDist = resolveOpenclawDist(); try { const files = readdirSync(openclawDist); const scannerFiles = files.filter( - (f) => (f.startsWith("skill-scanner") || f.startsWith("scanner-")) && f.endsWith(".js"), + (f) => + (f.startsWith("skill-scanner") || f.startsWith("scanner-")) && + (f.endsWith(".js") || f.endsWith(".mjs")), ); if (scannerFiles.length === 0) { scannerLoadError = `scanner chunk not found in ${openclawDist}`;