From 4ed3f7d165e5eb87e01f0340e27cae33f46f5d2b Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 2 Feb 2026 20:49:19 +0100 Subject: [PATCH] reorder and document types --- web_src/js/render/log.test.ts | 30 +++++++++++++++--------------- web_src/js/render/log.ts | 6 +++--- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/web_src/js/render/log.test.ts b/web_src/js/render/log.test.ts index 7e64a30b26..6677099dc3 100644 --- a/web_src/js/render/log.test.ts +++ b/web_src/js/render/log.test.ts @@ -6,15 +6,15 @@ function filterLogLines(logLines: LogLine[]): LogLine[] { test('filters workflow command lines from log output', () => { const inputLogLines: LogLine[] = [ - {index: 1, timestamp: 1000, message: 'Starting build process'}, - {index: 2, timestamp: 1001, message: '::add-matcher::.github/problem-matcher.json'}, - {index: 3, timestamp: 1002, message: 'Running tests...'}, - {index: 4, timestamp: 1003, message: '##[add-matcher].github/eslint.json'}, - {index: 5, timestamp: 1004, message: 'Test suite started'}, - {index: 6, timestamp: 1005, message: '::workflow-command::echo some-output'}, - {index: 7, timestamp: 1006, message: 'All tests passed'}, - {index: 8, timestamp: 1007, message: '::remove-matcher::owner=eslint'}, - {index: 9, timestamp: 1008, message: 'Build complete'}, + {index: 1, message: 'Starting build process', timestamp: 1000}, + {index: 2, message: '::add-matcher::.github/problem-matcher.json', timestamp: 1001}, + {index: 3, message: 'Running tests...', timestamp: 1002}, + {index: 4, message: '##[add-matcher].github/eslint.json', timestamp: 1003}, + {index: 5, message: 'Test suite started', timestamp: 1004}, + {index: 6, message: '::workflow-command::echo some-output', timestamp: 1005}, + {index: 7, message: 'All tests passed', timestamp: 1006}, + {index: 8, message: '::remove-matcher::owner=eslint', timestamp: 1007}, + {index: 9, message: 'Build complete', timestamp: 1008}, ]; expect(filterLogLines(inputLogLines).map((line) => line.message)).toMatchInlineSnapshot(` @@ -31,12 +31,12 @@ test('filters workflow command lines from log output', () => { test('preserves non-workflow command lines including group commands', () => { const inputLogLines: LogLine[] = [ - {index: 1, timestamp: 1000, message: 'Normal log line'}, - {index: 2, timestamp: 1001, message: '::group::Installation'}, - {index: 3, timestamp: 1002, message: 'Installing dependencies'}, - {index: 4, timestamp: 1003, message: '::add-matcher::.github/npm.json'}, - {index: 5, timestamp: 1004, message: '::endgroup::'}, - {index: 6, timestamp: 1005, message: 'Done'}, + {index: 1, message: 'Normal log line', timestamp: 1000}, + {index: 2, message: '::group::Installation', timestamp: 1001}, + {index: 3, message: 'Installing dependencies', timestamp: 1002}, + {index: 4, message: '::add-matcher::.github/npm.json', timestamp: 1003}, + {index: 5, message: '::endgroup::', timestamp: 1004}, + {index: 6, message: 'Done', timestamp: 1005}, ]; expect(filterLogLines(inputLogLines).map((line) => line.message)).toMatchInlineSnapshot(` diff --git a/web_src/js/render/log.ts b/web_src/js/render/log.ts index 1409ca7a87..d73bab4339 100644 --- a/web_src/js/render/log.ts +++ b/web_src/js/render/log.ts @@ -1,7 +1,7 @@ export type LogLine = { - index: number; - timestamp: number; - message: string; + index: number; // 1 + message: string; // "message" + timestamp: number; // 1770061591.330781 }; export const LogLinePrefixesGroup = ['::group::', '##[group]'];