Download packages/app/e2e/performance/unit/first-navigation-metrics.test.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 1.25 kB
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/app/e2e/performance/unit/first-navigation-metrics.test.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/app/e2e/performance/unit/first-navigation-metrics.test.ts
-
curl -L -o first-navigation-metrics.test.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/app/e2e/performance/unit/first-navigation-metrics.test.ts
1.25 kB
| import { expect, test } from "bun:test" | |
| import { summarizeFirstNavigation } from "../timeline/first-navigation-metrics" | |
| test("reports blank frames before first destination and stable paint", () => { | |
| expect( | |
| summarizeFirstNavigation([ | |
| { observedAtMs: 16, source: true, destination: false, content: true }, | |
| { observedAtMs: 32, source: false, destination: false, content: false }, | |
| { observedAtMs: 48, source: false, destination: true, content: true }, | |
| { observedAtMs: 64, source: false, destination: true, content: true }, | |
| { observedAtMs: 80, source: false, destination: true, content: true }, | |
| ]), | |
| ).toEqual({ | |
| samples: 5, | |
| firstDestinationObservedMs: 48, | |
| stableDestinationObservedMs: 80, | |
| sourceSamples: 1, | |
| blankSamples: 1, | |
| unknownSamples: 0, | |
| destinationSamples: 3, | |
| }) | |
| }) | |
| test("does not report stability for interrupted destination frames", () => { | |
| expect( | |
| summarizeFirstNavigation([ | |
| { observedAtMs: 16, source: false, destination: true, content: true }, | |
| { observedAtMs: 32, source: false, destination: false, content: true }, | |
| { observedAtMs: 48, source: false, destination: true, content: true }, | |
| ]).stableDestinationObservedMs, | |
| ).toBeNull() | |
| }) | |