Skip to content

Commit

Permalink
Use parseBadConfigValueErrorInfo in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiou87 committed Mar 13, 2024
1 parent 6081edf commit eb1d295
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions test/fast/errors-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,10 @@ describe('detects errors', () => {

expect(result).toHaveGitError(GitError.BadConfigValue)

const errorEntry = Object.entries(GitErrorRegexes).find(
([_, v]) => v === GitError.BadConfigValue
)

expect(errorEntry).not.toBe(null)
const m = result.stderr.match(errorEntry![0])

expect(m![1]).toBe('nab')
expect(m![2]).toBe('core.autocrlf')
const errorInfo = GitProcess.parseBadConfigValueErrorInfo(result.stderr)
expect(errorInfo).not.toBe(null)
expect(errorInfo!.value).toBe('nab')
expect(errorInfo!.key).toBe('core.autocrlf')
})
it('detects bad numeric config value', async () => {
const repoPath = await initialize('bad-config-repo')
Expand Down

0 comments on commit eb1d295

Please sign in to comment.