11'use strict'
22
3+ import path from 'path'
34import {
45 jest ,
56 describe ,
@@ -10,6 +11,8 @@ import {
1011} from '@jest/globals'
1112import EventEmitter from 'events'
1213
14+ const isWin = process . platform === 'win32'
15+
1316const mockSpawn = jest . fn ( )
1417const mockExecP = jest . fn ( )
1518
@@ -97,8 +100,8 @@ describe('AgentCoreCodeMode', () => {
97100 await mode . start ( mockCredentials )
98101
99102 expect ( mockSpawn ) . toHaveBeenCalledWith (
100- 'python3.13' ,
101- [ expect . stringContaining ( ' agents/ main.py' ) ] ,
103+ isWin ? 'python.exe' : 'python3.13' ,
104+ [ expect . stringContaining ( ` agents${ path . sep } main.py` ) ] ,
102105 expect . objectContaining ( {
103106 cwd : '/home/user/my-agent' ,
104107 env : expect . objectContaining ( {
@@ -123,7 +126,7 @@ describe('AgentCoreCodeMode', () => {
123126 await mode . start ( mockCredentials )
124127
125128 expect ( mockSpawn ) . toHaveBeenCalledWith (
126- 'python3.13' ,
129+ isWin ? 'python.exe' : 'python3.13' ,
127130 expect . any ( Array ) ,
128131 expect . any ( Object ) ,
129132 )
@@ -137,7 +140,7 @@ describe('AgentCoreCodeMode', () => {
137140 await mode . start ( mockCredentials )
138141
139142 expect ( mockSpawn ) . toHaveBeenCalledWith (
140- 'python3.12' ,
143+ isWin ? 'python.exe' : 'python3.12' ,
141144 expect . any ( Array ) ,
142145 expect . any ( Object ) ,
143146 )
@@ -151,7 +154,7 @@ describe('AgentCoreCodeMode', () => {
151154 await mode . start ( mockCredentials )
152155
153156 expect ( mockSpawn ) . toHaveBeenCalledWith (
154- 'python3.12' ,
157+ isWin ? 'python.exe' : 'python3.12' ,
155158 expect . any ( Array ) ,
156159 expect . any ( Object ) ,
157160 )
0 commit comments