mirror of
https://github.com/hanzoai/lint-staged.git
synced 2026-10-30 19:37:36 +00:00
21 lines
607 B
JavaScript
21 lines
607 B
JavaScript
import { describe, it } from 'vitest'
|
|
|
|
import { parseGitZOutput } from '../../lib/parseGitZOutput.js'
|
|
|
|
describe('parseGitZOutput', () => {
|
|
it('should split string from `git -z` control character', ({ expect }) => {
|
|
const input = 'a\u0000b\u0000c'
|
|
expect(parseGitZOutput(input)).toEqual(['a', 'b', 'c'])
|
|
})
|
|
|
|
it('should remove trailing `git -z` control character', ({ expect }) => {
|
|
const input = 'a\u0000'
|
|
expect(parseGitZOutput(input)).toEqual(['a'])
|
|
})
|
|
|
|
it('should handle empty input', ({ expect }) => {
|
|
const input = ''
|
|
expect(parseGitZOutput(input)).toEqual([])
|
|
})
|
|
})
|