Download mods/diff/tests/git/parse/parse-shortstat.test.ts from SaylorTwift/claude-code: direct link, hf CLI and curl.
- Browser
- Download file 852 Bytes
-
https://huggingface.co/SaylorTwift/claude-code/resolve/main/mods/diff/tests/git/parse/parse-shortstat.test.ts
- Command line
-
hf download hf://SaylorTwift/claude-code/mods/diff/tests/git/parse/parse-shortstat.test.ts
-
curl -L -o parse-shortstat.test.ts https://huggingface.co/SaylorTwift/claude-code/resolve/main/mods/diff/tests/git/parse/parse-shortstat.test.ts
852 Bytes
| import { describe, expect, test, tier } from 'claude-code/testing' | |
| import Parse from '../../../hooks/git/parse' | |
| tier('builtin') | |
| describe('parse-shortstat', () => { | |
| test('files, insertions and deletions; either tail optional', () => { | |
| expect( | |
| Parse.parseShortstat( | |
| ' 3 files changed, 10 insertions(+), 2 deletions(-)\n', | |
| ), | |
| ).toEqual({ filesCount: 3, linesAdded: 10, linesRemoved: 2 }) | |
| expect(Parse.parseShortstat(' 1 file changed, 1 insertion(+)\n')).toEqual({ | |
| filesCount: 1, | |
| linesAdded: 1, | |
| linesRemoved: 0, | |
| }) | |
| expect(Parse.parseShortstat(' 1 file changed, 4 deletions(-)\n')).toEqual({ | |
| filesCount: 1, | |
| linesAdded: 0, | |
| linesRemoved: 4, | |
| }) | |
| }) | |
| test('an empty diff prints nothing and parses to null', () => { | |
| expect(Parse.parseShortstat('')).toBeNull() | |
| }) | |
| }) | |