build: git context query format support

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2025-10-14 12:19:16 +02:00
parent 09c0f6a78e
commit 3bb4ae38ea
7 changed files with 135 additions and 69 deletions

View File

@@ -315,6 +315,7 @@ describe('hash', () => {
// https://github.com/golang/go/blob/f6b93a4c358b28b350dd8fe1780c1f78e520c09c/src/strconv/atob_test.go#L36-L58
describe('parseBool', () => {
[
{input: undefined, expected: false, throwsError: false},
{input: '', expected: false, throwsError: true},
{input: 'asdf', expected: false, throwsError: true},
{input: '0', expected: false, throwsError: false},
@@ -342,6 +343,13 @@ describe('parseBool', () => {
});
});
describe('parseBoolOrDefault', () => {
it('returns default value when input is invalid', () => {
expect(Util.parseBoolOrDefault('asdf')).toBe(false);
expect(Util.parseBoolOrDefault('asdf', true)).toBe(true);
});
});
describe('formatFileSize', () => {
test('should return "0 Bytes" when given 0 bytes', () => {
expect(Util.formatFileSize(0)).toBe('0 Bytes');