Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: make OpenCode installer test Windows-safe

[._.]/ Adam Eivyff382ebf30e9
diff --git a/server/services/opencodeInstaller.test.js b/server/services/opencodeInstaller.test.js
index 7b64e602e3..64bb2fd638 100644
--- a/server/services/opencodeInstaller.test.js
+++ b/server/services/opencodeInstaller.test.js
@@ -35,15 +35,25 @@ describe('OpenCode installer', () => {
spawnOpenCodeInstaller({ spawnImpl });
- expect(spawnImpl).toHaveBeenCalledWith(
- 'npm',
- OPENCODE_NPM_INSTALL_ARGS,
- expect.objectContaining({
- shell: false,
- stdio: ['ignore', 'pipe', 'pipe'],
- detached: process.platform !== 'win32',
- }),
- );
+ const [command, args, options] = spawnImpl.mock.calls[0];
+ if (process.platform === 'win32') {
+ // Windows must launch npm's .cmd shim through cmd.exe because Node
+ // rejects direct .cmd spawns when shell:false.
+ expect(command).toBe('cmd.exe');
+ expect(args).toEqual([
+ '/c',
+ expect.stringMatching(/npm\.cmd$/i),
+ ...OPENCODE_NPM_INSTALL_ARGS,
+ ]);
+ } else {
+ expect(command).toBe('npm');
+ expect(args).toEqual(OPENCODE_NPM_INSTALL_ARGS);
+ }
+ expect(options).toEqual(expect.objectContaining({
+ shell: false,
+ stdio: ['ignore', 'pipe', 'pipe'],
+ detached: process.platform !== 'win32',
+ }));
expect(OPENCODE_NPM_INSTALL_ARGS).toContain('--no-progress');
});
});