Files
rust-discovery/tests/browser/diagnostics.ts
T
BuTzZ 6c3203d725
Rust development slice / linux (push) Failing after 1m10s
feat: snapshot Linux-first RMM MVP and pause handover
2026-11-12 22:06:25 +01:00

8 lines
1.0 KiB
TypeScript

export const diagnosticSteps = ['management:login-banner', 'management:catalog-response', 'management:catalog-heading', 'management:membership-heading', 'management:unknown-stop', 'management:action-option', 'management:select-native', 'management:native-hint', 'management:identity-unchanged', 'management:inert-controls', 'management:logout'] as const;
export function diagnostic(label: string, error: { name?: string; message?: string } | undefined, line: number | undefined): string | null {
if (!error || !diagnosticSteps.some(step => step === label)) return null;
const name = ['Error', 'TimeoutError', 'TypeError', 'AssertionError', 'TestTimeoutError'].includes(error.name ?? '') ? error.name : 'Error';
const kind = /Timeout|timed out|timeout/i.test(error.message ?? '') ? 'timeout' : /expect\(|Assertion/i.test(error.message ?? '') ? 'assertion' : 'exception';
return `failure_step=${label} exception=${name} kind=${kind} source_line=${Number.isSafeInteger(line) && Number(line) > 0 ? line : 'unknown'}`;
}