fix: sql guard gaps, date tz, timeouts, payload
This commit is contained in:
@@ -109,6 +109,23 @@ describe('buildSshAuth', () => {
|
||||
expect(auth).toEqual({ agent: '/tmp/agent.sock' })
|
||||
})
|
||||
|
||||
it('throws when agent is requested but SSH_AUTH_SOCK is unset', () => {
|
||||
expect(() => buildSshAuth(sshConfig({ agent: true, password: 'pw' }), {})).toThrow(
|
||||
/SSH_AUTH_SOCK is not set/
|
||||
)
|
||||
})
|
||||
|
||||
it('throws when agent is requested but SSH_AUTH_SOCK is empty', () => {
|
||||
expect(() => buildSshAuth(sshConfig({ agent: true }), { SSH_AUTH_SOCK: '' })).toThrow(
|
||||
/SSH_AUTH_SOCK is not set/
|
||||
)
|
||||
})
|
||||
|
||||
it('still prefers privateKey over a requested agent', () => {
|
||||
const auth = buildSshAuth(sshConfig({ agent: true, privateKey: 'PEM' }), {})
|
||||
expect(auth).toEqual({ privateKey: 'PEM', passphrase: undefined })
|
||||
})
|
||||
|
||||
it('falls back to password', () => {
|
||||
expect(buildSshAuth(sshConfig({ password: 'pw' }))).toEqual({ password: 'pw' })
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user