11import { describe , it , expect , vi , beforeEach , afterEach } from 'vitest' ;
2+ import path from 'path' ;
23import {
34 validateAgentSocketPath ,
45 convertToSSHUrl ,
@@ -130,7 +131,7 @@ describe('sshHelpers', () => {
130131
131132 const knownHostsPath = await createKnownHostsFile ( tempDir , sshUrl ) ;
132133
133- expect ( knownHostsPath ) . toBe ( '/tmp/test-dir/ known_hosts') ;
134+ expect ( knownHostsPath ) . toBe ( path . join ( tempDir , ' known_hosts') ) ;
134135 expect ( childProcessStub . execSync ) . toHaveBeenCalledWith (
135136 'ssh-keyscan -t ed25519 github.com 2>/dev/null' ,
136137 expect . objectContaining ( {
@@ -139,7 +140,7 @@ describe('sshHelpers', () => {
139140 } ) ,
140141 ) ;
141142 expect ( fsStub . promises . writeFile ) . toHaveBeenCalledWith (
142- '/tmp/test-dir/ known_hosts',
143+ path . join ( tempDir , ' known_hosts') ,
143144 expect . stringContaining ( 'github.com ssh-ed25519' ) ,
144145 { mode : 0o600 } ,
145146 ) ;
@@ -155,7 +156,7 @@ describe('sshHelpers', () => {
155156
156157 const knownHostsPath = await createKnownHostsFile ( tempDir , sshUrl ) ;
157158
158- expect ( knownHostsPath ) . toBe ( '/tmp/test-dir/ known_hosts') ;
159+ expect ( knownHostsPath ) . toBe ( path . join ( tempDir , ' known_hosts') ) ;
159160 expect ( childProcessStub . execSync ) . toHaveBeenCalledWith (
160161 'ssh-keyscan -t ed25519 gitlab.com 2>/dev/null' ,
161162 expect . anything ( ) ,
0 commit comments