From 8bcca88282f63db11c540a4443bc3ed338ccee3e Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Sun, 27 Sep 2026 07:02:22 -0500 Subject: [PATCH] test(desktop): match the desktop.mjs compile step with native path separators The --icons case found the compile command with endsWith('/scripts/build/desktop.mjs'), which never matches the path.join-built argument on Windows, so the case failed with TypeError instead of asserting. Match both separator styles. Fixes https://github.com/NousResearch/hermes-agent/issues/125139 --- tests-js/desktop-builder.test.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests-js/desktop-builder.test.mjs b/tests-js/desktop-builder.test.mjs index 08164191c5..e33d7d8635 100644 --- a/tests-js/desktop-builder.test.mjs +++ b/tests-js/desktop-builder.test.mjs @@ -18,7 +18,8 @@ test('desktop development composition reuses prepared icon pixels instead of pro run: (command, args) => commands.push([command, ...args]), }) expect(readFileSync(join(input.source, 'apps/desktop/assets/icon.ico'), 'utf8')).toBe('prepared packaging icon') - const compile = commands.find(command => command.some(arg => arg.endsWith('/scripts/build/desktop.mjs'))) + // path.join builds platform-native separators, so accept both `/` and `\`. + const compile = commands.find(command => command.some(arg => /[/\\]scripts[/\\]build[/\\]desktop\.mjs$/.test(arg))) expect(compile[compile.indexOf('--icons') + 1]).toBe(input.icons) }) afterEach(() => { for (const root of roots.splice(0)) rmSync(root, { recursive: true, force: true }) })