Skip to content

Commit da2ad80

Browse files
committed
split assertion
1 parent 0ae1485 commit da2ad80

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/core/src/test/shared/extensions/ssh.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ function echoEnvVarsCmd(varNames: string[]) {
4242
return `echo "${varNames.map(toShell).join(' ')}"`
4343
}
4444

45+
/**
46+
* Trim noisy windows ChildProcess result to final line for easier testing.
47+
*/
4548
function assertOutputContains(rawOutput: string, expectedString: string): void | never {
46-
// Windows gives some junk we want to trim
4749
const output = rawOutput.trim().split('\n').at(-1)?.replace('"', '') ?? ''
4850
assert.ok(output.includes(expectedString), `Expected output to contain "${expectedString}", but got "${output}"`)
4951
}
@@ -104,6 +106,7 @@ describe('testSshConnection', function () {
104106
const process = createBoundProcess(async () => ({}))
105107
await createExecutableFile(sshPath, executableFileContent)
106108
const r = await testSshConnection(process, 'localhost', sshPath, 'test-user', {} as SSM.StartSessionResponse)
107-
assertOutputContains(r.stdout, '-T test-user@localhost')
109+
assertOutputContains(r.stdout, '-T')
110+
assertOutputContains(r.stdout, 'test-user@localhost')
108111
})
109112
})

0 commit comments

Comments
 (0)