11import { afterEach , describe , expect , test } from "bun:test" ;
22import { mkdirSync , mkdtempSync , realpathSync , rmSync , symlinkSync , writeFileSync } from "node:fs" ;
3- import { tmpdir } from "node:os" ;
3+ import { platform , tmpdir } from "node:os" ;
44import { join } from "node:path" ;
55import { loadAppBootstrap } from "./loaders" ;
66import type { CliInput } from "./types" ;
@@ -201,7 +201,7 @@ describe("loadAppBootstrap", () => {
201201 ) ,
202202 ) ;
203203
204- expect ( bootstrap . changeset . sourceLabel ) . toBe ( dir ) ;
204+ expect ( bootstrap . changeset . sourceLabel . replace ( / \\ / g , "/" ) ) . toBe ( dir . replace ( / \\ / g , "/" ) ) ;
205205 expect ( bootstrap . changeset . files [ 0 ] ?. path ) . toBe ( "example.ts" ) ;
206206 expect ( bootstrap . changeset . files [ 0 ] ?. agent ?. annotations ) . toHaveLength ( 1 ) ;
207207 } ) ;
@@ -346,7 +346,7 @@ describe("loadAppBootstrap", () => {
346346 writeFileSync ( join ( dir , "tracked.ts" ) , "export const tracked = 1;\n" ) ;
347347 git ( dir , "add" , "tracked.ts" ) ;
348348 git ( dir , "commit" , "-m" , "initial" ) ;
349- git ( dir , "branch" , "main " ) ;
349+ git ( dir , "branch" , "base-branch " ) ;
350350
351351 writeFileSync ( join ( dir , "tracked.ts" ) , "export const tracked = 2;\n" ) ;
352352 git ( dir , "add" , "tracked.ts" ) ;
@@ -357,7 +357,7 @@ describe("loadAppBootstrap", () => {
357357
358358 const bootstrap = await loadFromRepo ( dir , {
359359 kind : "vcs" ,
360- range : "main " ,
360+ range : "base-branch " ,
361361 staged : false ,
362362 options : { mode : "auto" } ,
363363 } ) ;
@@ -374,7 +374,7 @@ describe("loadAppBootstrap", () => {
374374 writeFileSync ( join ( dir , "tracked.ts" ) , "export const tracked = 1;\n" ) ;
375375 git ( dir , "add" , "tracked.ts" ) ;
376376 git ( dir , "commit" , "-m" , "initial" ) ;
377- git ( dir , "branch" , "main " ) ;
377+ git ( dir , "branch" , "base-branch " ) ;
378378
379379 writeFileSync ( join ( dir , "tracked.ts" ) , "export const tracked = 2;\n" ) ;
380380 git ( dir , "add" , "tracked.ts" ) ;
@@ -385,7 +385,7 @@ describe("loadAppBootstrap", () => {
385385
386386 const bootstrap = await loadFromRepo ( dir , {
387387 kind : "vcs" ,
388- range : "main ..HEAD" ,
388+ range : "base-branch ..HEAD" ,
389389 staged : false ,
390390 options : { mode : "auto" } ,
391391 } ) ;
@@ -418,6 +418,10 @@ describe("loadAppBootstrap", () => {
418418 } ) ;
419419
420420 test ( "loads untracked files whose names need parser-safe diff headers" , async ( ) => {
421+ if ( platform ( ) === "win32" ) {
422+ return ;
423+ }
424+
421425 const dir = createTempRepo ( "hunk-git-quoted-untracked-" ) ;
422426
423427 writeFileSync ( join ( dir , "tracked.ts" ) , "export const tracked = 1;\n" ) ;
@@ -967,7 +971,7 @@ describe("loadAppBootstrap", () => {
967971 writeFileSync ( after , "export const answer = 42;\nexport const added = true;\n" ) ;
968972
969973 const diffProc = Bun . spawnSync (
970- [ "git" , "diff" , "--no-index" , "--color=always" , "--" , before , after ] ,
974+ [ "git" , "diff" , "--no-index" , "--color=always" , "--" , " before.ts" , " after.ts" ] ,
971975 {
972976 cwd : dir ,
973977 stdin : "ignore" ,
0 commit comments