@@ -139,8 +139,18 @@ describe("t3 server command safety", () => {
139139 withTempDirectory ( "t3-cli-unknown-" , ( root ) =>
140140 Effect . gen ( function * ( ) {
141141 const baseDir = NodePath . join ( root , "home" ) ;
142- for ( const word of [ "account" , "login" , "clients" , "conenct" , "package.json" ] ) {
143- const error = yield * runCli ( [ word , "--base-dir" , baseDir ] ) . pipe ( Effect . flip ) ;
142+ for ( const word of [
143+ "account" ,
144+ "login" ,
145+ "clients" ,
146+ "conenct" ,
147+ "package.json" ,
148+ "C:new-project" ,
149+ ] ) {
150+ const error = yield * runCli ( [ word , "--base-dir" , baseDir ] ) . pipe (
151+ Effect . provideService ( HostProcessPlatform , "linux" ) ,
152+ Effect . flip ,
153+ ) ;
144154 expect ( String ( error ) ) . toContain ( `Unknown command "${ word } "` ) ;
145155 expect ( yield * pathExists ( word ) ) . toBe ( word === "package.json" ) ;
146156 expect ( yield * pathExists ( baseDir ) ) . toBe ( false ) ;
@@ -177,6 +187,7 @@ describe("t3 server command safety", () => {
177187 yield * Effect . promise ( ( ) => NodeFSP . mkdir ( stateDir , { recursive : true } ) ) ;
178188 yield * Effect . promise ( ( ) => NodeFSP . writeFile ( statePath , record ) ) ;
179189 const newDirectory = NodePath . join ( root , "new-project" ) ;
190+ const platform = yield * HostProcessPlatform ;
180191 for ( const args of [
181192 [ ] ,
182193 [ "start" ] ,
@@ -186,7 +197,13 @@ describe("t3 server command safety", () => {
186197 [ newDirectory ] ,
187198 [ "start" , newDirectory ] ,
188199 ] ) {
189- const error = yield * runCli ( args , { T3CODE_HOME : baseDir } ) . pipe ( Effect . flip ) ;
200+ const error = yield * runCli ( args , { T3CODE_HOME : baseDir } ) . pipe (
201+ Effect . provideService (
202+ HostProcessPlatform ,
203+ args [ 0 ] === "C:new-project" ? "win32" : platform ,
204+ ) ,
205+ Effect . flip ,
206+ ) ;
190207 expect ( String ( error ) ) . toContain ( "A T3 Code server is already running" ) ;
191208 expect ( yield * Effect . promise ( ( ) => NodeFSP . readFile ( statePath , "utf8" ) ) ) . toBe ( record ) ;
192209 expect ( yield * pathExists ( newDirectory ) ) . toBe ( false ) ;
0 commit comments