@@ -46,28 +46,26 @@ test("applyTargetDir warns and falls back to copy when symlink fails", async ()
4646 assert . match ( stderr , / W a r n i n g : F a i l e d t o c r e a t e s y m l i n k / i) ;
4747} ) ;
4848
49- test (
50- "applyTargetDir uses relative symlink targets on non-Windows" ,
51- { skip : process . platform === "win32" } ,
52- async ( ) => {
53- const tmpRoot = path . join (
54- tmpdir ( ) ,
55- `docs-cache-target-relative-${ Date . now ( ) . toString ( 36 ) } ` ,
56- ) ;
57- const sourceDir = path . join ( tmpRoot , "source" ) ;
58- const targetDir = path . join ( tmpRoot , "target" ) ;
59- const parentDir = path . dirname ( targetDir ) ;
49+ test ( "applyTargetDir uses relative symlink targets on non-Windows" , {
50+ skip : process . platform === "win32" ,
51+ } , async ( ) => {
52+ const tmpRoot = path . join (
53+ tmpdir ( ) ,
54+ `docs-cache-target-relative-${ Date . now ( ) . toString ( 36 ) } ` ,
55+ ) ;
56+ const sourceDir = path . join ( tmpRoot , "source" ) ;
57+ const targetDir = path . join ( tmpRoot , "target" ) ;
58+ const parentDir = path . dirname ( targetDir ) ;
6059
61- await mkdir ( sourceDir , { recursive : true } ) ;
62- await writeFile ( path . join ( sourceDir , "README.md" ) , "hello" , "utf8" ) ;
60+ await mkdir ( sourceDir , { recursive : true } ) ;
61+ await writeFile ( path . join ( sourceDir , "README.md" ) , "hello" , "utf8" ) ;
6362
64- await applyTargetDir ( {
65- sourceDir,
66- targetDir,
67- mode : "symlink" ,
68- } ) ;
63+ await applyTargetDir ( {
64+ sourceDir,
65+ targetDir,
66+ mode : "symlink" ,
67+ } ) ;
6968
70- const linkTarget = await readlink ( targetDir ) ;
71- assert . equal ( linkTarget , path . relative ( parentDir , sourceDir ) ) ;
72- } ,
73- ) ;
69+ const linkTarget = await readlink ( targetDir ) ;
70+ assert . equal ( linkTarget , path . relative ( parentDir , sourceDir ) ) ;
71+ } ) ;
0 commit comments