Skip to content

Commit 6bec701

Browse files
committed
adjust tests
1 parent bd292c2 commit 6bec701

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/core/src/test/shared/utilities/pathFind.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ describe('pathFind', function () {
7474

7575
it('only returns valid executable ssh path (CI + Local Non-Windows)', async function () {
7676
// In CI, we can assume Windows machines will have ssh.
77-
if (!isCI()) {
77+
if (!isCI() && isWin()) {
7878
return
7979
}
8080
// On local non-windows, we can overwrite path and create our own executable to find.
@@ -95,31 +95,31 @@ describe('pathFind', function () {
9595

9696
it('caches result from previous runs (CI + Local Non-Windows)', async function () {
9797
// In CI, we can assume Windows machines will have ssh.
98-
if (!isCI()) {
98+
if (!isCI() && isWin()) {
9999
return
100100
}
101101
// On local non-windows, we can overwrite path and create our own executable to find.
102102
const workspace = await testutil.createTestWorkspaceFolder()
103103
// We move the ssh to a temp directory temporarily to test if cache works.
104104
const tempLocation = path.join(workspace.uri.fsPath, 'temp-ssh')
105+
const fakeSshPath = path.join(workspace.uri.fsPath, `ssh`)
105106

106107
if (!isWin()) {
107-
const fakeSshPath = path.join(workspace.uri.fsPath, `ssh`)
108-
109108
testutil.setEnv(testutil.envWithNewPath(workspace.uri.fsPath))
110109

111110
await testutil.createExecutableFile(fakeSshPath, '')
112111
}
113112

114113
const ssh1 = await findSshPath(true)
114+
const originalSshPath = ssh1! === 'ssh' ? fakeSshPath : ssh1!
115115

116-
await fs.rename(ssh1!, tempLocation)
116+
await fs.rename(originalSshPath, tempLocation)
117117

118118
const ssh2 = await findSshPath(true)
119119

120120
assert.strictEqual(ssh1, ssh2)
121121

122-
await fs.rename(tempLocation, ssh1!)
122+
await fs.rename(tempLocation, originalSshPath)
123123
})
124124
})
125125
})

0 commit comments

Comments
 (0)