MCPcopy Create free account
hub / github.com/netlify/cli / normalizeSnapshot

Function normalizeSnapshot

tests/integration/framework-detection.test.ts:16–30  ·  view source on GitHub ↗
(
  snapshot: string,
  opts: { duration?: boolean | undefined; filePath?: boolean | undefined } = {},
)

Source from the content-addressed store, hash-verified

14// Normalize random ports. Not only are these ports random, but since the number of digits
15// in the port can vary, the formatting of the ASCII box drawn around it also varies.
16const normalizeSnapshot = (
17 snapshot: string,
18 opts: { duration?: boolean | undefined; filePath?: boolean | undefined } = {},
19) =>
20 normalize(snapshot, opts).replace(
21 // eslint-disable-next-line no-irregular-whitespace
22 /⬥ Static server listening to \d+[\s╭─│─╰╮╯⬥ ]+ Local dev server ready: http:\/\/localhost:\d+ [\s╭─│─╰╮╯]+/m,
23 `⬥ Static server listening to <SNAPSHOT_PORT_NORMALIZED>
24
25 ┌──────────────────────────────────────────────────────────────────────────┐
26 │ │
27 │ Local dev server ready: http://localhost:<SNAPSHOT_PORT_NORMALIZED> │
28 │ │
29 └──────────────────────────────────────────────────────────────────────────┘`,
30 )
31
32describe.concurrent('frameworks/framework-detection', () => {
33 test('should default to process.cwd() and static server', async (t) => {

Callers 1

Calls 1

normalizeFunction · 0.85

Tested by

no test coverage detected