@unframework.dev/testing 0.0.0-stage → 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/README.md +511 -2
  2. package/dist/browser/axe.js +34 -0
  3. package/dist/browser/behaviour.js +59 -0
  4. package/dist/browser/capabilities.js +58 -0
  5. package/dist/browser/clock.d.ts +17 -0
  6. package/dist/browser/clock.js +69 -0
  7. package/dist/browser/console.d.ts +27 -0
  8. package/dist/browser/console.js +142 -0
  9. package/dist/browser/determinism.js +108 -0
  10. package/dist/browser/element-timeout.js +28 -0
  11. package/dist/browser/events.js +68 -0
  12. package/dist/browser/geometry.js +135 -0
  13. package/dist/browser/keys.js +62 -0
  14. package/dist/browser/matchers.d.ts +39 -0
  15. package/dist/browser/matchers.js +78 -0
  16. package/dist/browser/navigation.js +38 -0
  17. package/dist/browser/parity.d.ts +10 -0
  18. package/dist/browser/parity.js +93 -0
  19. package/dist/browser/spec.d.ts +25 -0
  20. package/dist/browser/spec.js +38 -0
  21. package/dist/browser/target.d.ts +16 -0
  22. package/dist/browser/target.js +27 -0
  23. package/dist/browser/text-runs.js +68 -0
  24. package/dist/browser/thrown.js +71 -0
  25. package/dist/browser/trace.d.ts +21 -0
  26. package/dist/browser/trace.js +73 -0
  27. package/dist/browser/user.d.ts +45 -0
  28. package/dist/browser/user.js +184 -0
  29. package/dist/browser/view.d.ts +114 -0
  30. package/dist/browser/view.js +282 -0
  31. package/dist/browser/visual.d.ts +20 -0
  32. package/dist/browser/visual.js +36 -0
  33. package/dist/cli.d.ts +23 -0
  34. package/dist/cli.js +90 -0
  35. package/dist/commands.d.ts +107 -0
  36. package/dist/config/broadcast.js +29 -0
  37. package/dist/config/cases.d.ts +28 -0
  38. package/dist/config/cases.js +94 -0
  39. package/dist/config/index.d.ts +81 -0
  40. package/dist/config/index.js +275 -0
  41. package/dist/diff.d.ts +14 -0
  42. package/dist/diff.js +92 -0
  43. package/dist/dom/serialize.js +236 -0
  44. package/dist/errors.d.ts +13 -0
  45. package/dist/errors.js +38 -0
  46. package/dist/harness.d.ts +184 -0
  47. package/dist/harness.js +53 -0
  48. package/dist/index.d.ts +16 -0
  49. package/dist/index.js +12 -0
  50. package/dist/internal.d.ts +8 -0
  51. package/dist/internal.js +6 -0
  52. package/dist/layers.d.ts +183 -0
  53. package/dist/layers.js +241 -0
  54. package/dist/node/browser.d.ts +33 -0
  55. package/dist/node/browser.js +64 -0
  56. package/dist/node/commands.d.ts +137 -0
  57. package/dist/node/commands.js +139 -0
  58. package/dist/node/context.d.ts +28 -0
  59. package/dist/node/context.js +55 -0
  60. package/dist/node/events.d.ts +25 -0
  61. package/dist/node/events.js +50 -0
  62. package/dist/node/finished.d.ts +12 -0
  63. package/dist/node/finished.js +28 -0
  64. package/dist/node/index.d.ts +21 -0
  65. package/dist/node/index.js +20 -0
  66. package/dist/node/matrix.d.ts +219 -0
  67. package/dist/node/matrix.js +309 -0
  68. package/dist/node/mode.d.ts +101 -0
  69. package/dist/node/mode.js +201 -0
  70. package/dist/node/names.d.ts +4 -0
  71. package/dist/node/names.js +5 -0
  72. package/dist/node/policy.d.ts +44 -0
  73. package/dist/node/policy.js +140 -0
  74. package/dist/node/reporter.d.ts +101 -0
  75. package/dist/node/reporter.js +251 -0
  76. package/dist/node/summary.d.ts +99 -0
  77. package/dist/node/summary.js +352 -0
  78. package/dist/node/thrown.js +78 -0
  79. package/dist/node/viewport.d.ts +7 -0
  80. package/dist/node/viewport.js +8 -0
  81. package/dist/node/visual.d.ts +85 -0
  82. package/dist/node/visual.js +370 -0
  83. package/dist/node_modules/.pnpm/playwright-core@1.63.0/node_modules/playwright-core/types/protocol.d.ts +23930 -0
  84. package/dist/node_modules/.pnpm/playwright-core@1.63.0/node_modules/playwright-core/types/structs.d.ts +22 -0
  85. package/dist/node_modules/.pnpm/playwright-core@1.63.0/node_modules/playwright-core/types/types.d.ts +22221 -0
  86. package/dist/normalize/display.js +309 -0
  87. package/dist/normalize/index.d.ts +34 -0
  88. package/dist/normalize/index.js +38 -0
  89. package/dist/normalize/pipeline.d.ts +19 -0
  90. package/dist/normalize/pipeline.js +45 -0
  91. package/dist/normalize/print.js +103 -0
  92. package/dist/normalize/rules/angular-hosts.js +53 -0
  93. package/dist/normalize/rules/aria-hosts.js +48 -0
  94. package/dist/normalize/rules/comments.js +16 -0
  95. package/dist/normalize/rules/control-values.js +65 -0
  96. package/dist/normalize/rules/engine-aliases.js +34 -0
  97. package/dist/normalize/rules/framework-attributes.js +85 -0
  98. package/dist/normalize/rules/generated-ids.js +64 -0
  99. package/dist/normalize/rules/ordering.js +39 -0
  100. package/dist/normalize/rules/qwik-styles.js +21 -0
  101. package/dist/normalize/rules/qwik-templates.js +20 -0
  102. package/dist/normalize/rules/values.js +125 -0
  103. package/dist/normalize/rules/whitespace.js +381 -0
  104. package/dist/normalize/style.js +121 -0
  105. package/dist/normalize/targets.d.ts +8 -0
  106. package/dist/normalize/targets.js +17 -0
  107. package/dist/normalize/tree.d.ts +1 -0
  108. package/dist/normalize/tree.js +151 -0
  109. package/dist/setup.d.ts +1 -0
  110. package/dist/setup.js +149 -0
  111. package/dist/ssr/index.d.ts +10 -0
  112. package/dist/ssr/index.js +103 -0
  113. package/dist/ssr/spec.d.ts +1 -0
  114. package/dist/ssr/spec.js +7 -0
  115. package/dist/targets/angular.d.ts +1 -0
  116. package/dist/targets/angular.js +5 -0
  117. package/dist/targets/astro.d.ts +1 -0
  118. package/dist/targets/astro.js +5 -0
  119. package/dist/targets/qwik.d.ts +1 -0
  120. package/dist/targets/qwik.js +5 -0
  121. package/dist/targets/react.d.ts +1 -0
  122. package/dist/targets/react.js +5 -0
  123. package/dist/targets/solid.d.ts +1 -0
  124. package/dist/targets/solid.js +5 -0
  125. package/dist/targets/svelte.d.ts +1 -0
  126. package/dist/targets/svelte.js +5 -0
  127. package/dist/targets/vue.d.ts +1 -0
  128. package/dist/targets/vue.js +5 -0
  129. package/dist/visual-types.d.ts +92 -0
  130. package/dist/visual-types.js +24 -0
  131. package/package.json +135 -3
@@ -0,0 +1,370 @@
1
+ import { caseReference } from "../harness.js";
2
+ import { caseDirectory, displayRoot, projectHarness } from "./context.js";
3
+ import { specFinished } from "./finished.js";
4
+ import { KEBAB_CASE } from "./names.js";
5
+ import { writeIfChanged } from "./policy.js";
6
+ import { BASELINE_ENVIRONMENT } from "./mode.js";
7
+ import { existsSync, readFileSync } from "node:fs";
8
+ import { join, relative, sep } from "node:path";
9
+ import pixelmatch from "pixelmatch";
10
+ import { PNG } from "pngjs";
11
+ //#region src/node/visual.ts
12
+ /** The font file's internal family name that CDP reports for the bundled "UF Test Sans". */
13
+ const ALLOWED_FONTS = ["Inter"];
14
+ /** Baseline PNGs are named after the browser and the platform that produced them. */
15
+ const BROWSER = "chromium";
16
+ const BASELINE_PLATFORM = "linux";
17
+ /**
18
+ * Per process: the reference's captures in this run, by run, case and scenario. Commands run in
19
+ * Vitest's main process, so every browser project of a run shares this.
20
+ */
21
+ const STATE = Symbol.for("unframework.visual.references");
22
+ function references() {
23
+ const store = globalThis;
24
+ return store[STATE] ??= /* @__PURE__ */ new Map();
25
+ }
26
+ const cdpSessions = /* @__PURE__ */ new WeakMap();
27
+ /** A case's scenario as L10 locates it: the case's `__screenshots__/` and `__expected__/`. */
28
+ function caseCaptureLocation(harness, caseId, name, target) {
29
+ const caseDir = caseDirectory(harness, caseId);
30
+ return {
31
+ key: `${caseId}/${name}`,
32
+ label: `${caseId}/${name}`,
33
+ case: caseId,
34
+ reference: caseReference(harness, caseId),
35
+ baselinePng: join(caseDir, "__screenshots__", baselineFileName(name)),
36
+ geometry: join(caseDir, "__expected__", `geometry.${name}.json`),
37
+ livePng: join(harness.liveDir, caseId, `${name}.png`),
38
+ diffs: join(harness.diffsDir, caseId, `${name}.${target}`),
39
+ baselineCommand: "pnpm test:baselines"
40
+ };
41
+ }
42
+ /** A baseline PNG's file name: the scenario, then the browser and platform that produced it. */
43
+ function baselineFileName(name) {
44
+ return `${name}-${BROWSER}-${BASELINE_PLATFORM}.png`;
45
+ }
46
+ /** `ufVisualCapture`: the L10 command. */
47
+ async function ufVisualCapture(context, request) {
48
+ const { target, harness } = projectHarness(context);
49
+ const location = caseCaptureLocation(harness, request.case, request.name, target);
50
+ if (!KEBAB_CASE.test(request.name)) throw new Error(`[uf:visual] "${request.name}" is not a kebab-case scenario name.`);
51
+ return captureAt(context, request, location);
52
+ }
53
+ /**
54
+ * L10 at a location: audits the fonts, captures a stable PNG, then publishes, writes or compares
55
+ * it under the run's policy. The corpus's command and a project's examples both run it.
56
+ */
57
+ async function captureAt(context, request, location) {
58
+ const { target, harness } = projectHarness(context);
59
+ if (request.tolerance && !request.tolerance.reason.trim()) throw new Error(`[uf:visual] ${location.label}: a tolerance needs a reason.`);
60
+ const root = displayRoot(harness);
61
+ const rel = (file) => relative(root, file).split(sep).join("/");
62
+ const reference = location.reference;
63
+ const isReference = target === reference;
64
+ const mode = `${harness.update ? "update" : "check"}+${harness.pixels}`;
65
+ const key = `${harness.runId}:${location.key}`;
66
+ const paths = {
67
+ baselinePng: location.baselinePng,
68
+ geometry: location.geometry,
69
+ livePng: location.livePng,
70
+ diffs: location.diffs
71
+ };
72
+ let captured = false;
73
+ const done = (result) => ({
74
+ mode,
75
+ role: isReference ? "reference" : "follower",
76
+ attachments: [],
77
+ ...location.capture && captured ? { capture: location.capture } : {},
78
+ ...result
79
+ });
80
+ const fontViolations = harness.browser === "chromium" ? await fontAudit(context.page, request.marker) : [];
81
+ if (fontViolations.length) return done({
82
+ pass: false,
83
+ outcome: "font-fallback",
84
+ message: `Text rendered with a font outside the bundle:\n ${fontViolations.join("\n ")}`
85
+ });
86
+ const png = await stableCapture(context, request);
87
+ if (!png) return done({
88
+ pass: false,
89
+ outcome: "unstable",
90
+ message: "Could not capture two identical consecutive screenshots."
91
+ });
92
+ const geometryJson = `${JSON.stringify(request.geometry, null, 2)}\n`;
93
+ if (location.capture) {
94
+ writeIfChanged(location.capture, png);
95
+ captured = true;
96
+ }
97
+ if (isReference && harness.pixels === "live") {
98
+ writeIfChanged(paths.livePng, png);
99
+ references().set(key, {
100
+ png: paths.livePng,
101
+ geometry: request.geometry
102
+ });
103
+ return done({
104
+ pass: true,
105
+ outcome: "published-reference",
106
+ message: "The reference's capture is this run's expectation (live)."
107
+ });
108
+ }
109
+ if (isReference && harness.update) {
110
+ if (harness.baselineEnvironment !== "mcr.microsoft.com/playwright:v1.63.0-noble linux/amd64") return done({
111
+ pass: false,
112
+ outcome: "refused-write",
113
+ message: `Refusing to write ${rel(paths.geometry)} and ${rel(paths.baselinePng)}: the committed baselines come from ${BASELINE_ENVIRONMENT} (\`${location.baselineCommand}\`), and this run is in ${harness.baselineEnvironment ?? "another environment"}.`
114
+ });
115
+ writeIfChanged(paths.geometry, geometryJson);
116
+ writeIfChanged(paths.baselinePng, png);
117
+ references().set(key, {
118
+ png: paths.baselinePng,
119
+ geometry: request.geometry
120
+ });
121
+ return done({
122
+ pass: true,
123
+ outcome: "wrote-reference",
124
+ message: `wrote ${rel(paths.geometry)} and ${rel(paths.baselinePng)}`
125
+ });
126
+ }
127
+ const fromReference = harness.pixels === "live" || harness.update;
128
+ const geometryAgainst = fromReference ? `${reference}'s capture in this run` : rel(paths.geometry);
129
+ let expectedGeometry;
130
+ let expectedPng;
131
+ if (fromReference) {
132
+ const fromThisRun = references().get(key);
133
+ if (!fromThisRun) {
134
+ writeIfChanged(join(paths.diffs, "actual.png"), png);
135
+ const referenceProject = browserProjectOf(context, reference);
136
+ if (referenceProject !== void 0 && !specFinished(harness.runId, reference, location.case)) return done({
137
+ pass: false,
138
+ outcome: "reference-not-run",
139
+ referenceProject,
140
+ message: `The reference's browser project (${referenceProject}) did not finish ${location.case}'s spec file in this run, so ${location.label} has nothing to compare with.`
141
+ });
142
+ return done({
143
+ pass: false,
144
+ outcome: "missing-reference-capture",
145
+ message: missingReference(reference, location.label, harness.update ? "update" : "live")
146
+ });
147
+ }
148
+ expectedGeometry = fromThisRun.geometry;
149
+ expectedPng = fromThisRun.png;
150
+ } else {
151
+ const missing = [paths.geometry, paths.baselinePng].filter((file) => !existsSync(file));
152
+ if (missing.length) {
153
+ writeIfChanged(join(paths.diffs, "geometry.actual.json"), geometryJson);
154
+ writeIfChanged(join(paths.diffs, "actual.png"), png);
155
+ return done({
156
+ pass: false,
157
+ outcome: "missing-artefact",
158
+ message: `Missing artefact ${missing.map(rel).join(" and ")}. Run \`${location.baselineCommand}\` to write it (the reference target, ${reference}, in the Linux image).`
159
+ });
160
+ }
161
+ expectedGeometry = JSON.parse(readFileSync(paths.geometry, "utf8"));
162
+ expectedPng = paths.baselinePng;
163
+ }
164
+ const geometryDiff = diffGeometry(expectedGeometry, request.geometry);
165
+ const actual = PNG.sync.read(png);
166
+ const expectedBuffer = readFileSync(expectedPng);
167
+ const expected = PNG.sync.read(expectedBuffer);
168
+ const against = rel(expectedPng);
169
+ const attachments = [];
170
+ const recordFailure = (diff) => {
171
+ const images = [[
172
+ "reference",
173
+ expectedBuffer,
174
+ expected
175
+ ], [
176
+ "actual",
177
+ png,
178
+ actual
179
+ ]];
180
+ if (diff) images.push([
181
+ "diff",
182
+ PNG.sync.write(diff),
183
+ diff
184
+ ]);
185
+ for (const [name, buffer, image] of images) {
186
+ const file = join(paths.diffs, `${name}.png`);
187
+ writeIfChanged(file, buffer);
188
+ attachments.push({
189
+ name,
190
+ path: file,
191
+ width: image.width,
192
+ height: image.height
193
+ });
194
+ }
195
+ writeIfChanged(join(paths.diffs, "geometry.actual.json"), geometryJson);
196
+ };
197
+ if (expected.width !== actual.width || expected.height !== actual.height) {
198
+ recordFailure();
199
+ return done({
200
+ pass: false,
201
+ outcome: geometryDiff.length ? "geometry-mismatch" : "size-mismatch",
202
+ message: [...formatGeometryDiff(geometryDiff, geometryAgainst), `The capture is ${actual.width}×${actual.height}px; ${against} is ${expected.width}×${expected.height}px.`].join("\n"),
203
+ attachments,
204
+ deltas: geometryDiff
205
+ });
206
+ }
207
+ const diffPixels = countDifferentPixels(expected.data, actual.data);
208
+ const allowed = request.tolerance?.maxDiffPixels ?? 0;
209
+ if (geometryDiff.length || diffPixels > allowed) {
210
+ const diff = new PNG({
211
+ width: actual.width,
212
+ height: actual.height
213
+ });
214
+ pixelmatch(expected.data, actual.data, diff.data, actual.width, actual.height, {
215
+ threshold: 0,
216
+ includeAA: true,
217
+ alpha: .2
218
+ });
219
+ recordFailure(diff);
220
+ return done({
221
+ pass: false,
222
+ outcome: geometryDiff.length ? "geometry-mismatch" : "pixel-mismatch",
223
+ diffPixels,
224
+ message: [...formatGeometryDiff(geometryDiff, geometryAgainst), `${diffPixels} pixel(s) differ from ${against} (allowed: ${allowed}${request.tolerance ? `, because ${request.tolerance.reason}` : ""}).`].join("\n"),
225
+ attachments,
226
+ deltas: geometryDiff
227
+ });
228
+ }
229
+ return done({
230
+ pass: true,
231
+ outcome: diffPixels ? "matched-within-tolerance" : "matched",
232
+ diffPixels,
233
+ message: diffPixels ? `${diffPixels} pixel(s) differ, within tolerance: ${request.tolerance?.reason}` : ""
234
+ });
235
+ }
236
+ /** Captures until two consecutive screenshots are byte-identical (up to 11 captures). */
237
+ async function stableCapture(context, request) {
238
+ const locator = context.iframe.locator(request.element.selector);
239
+ const shoot = () => locator.screenshot({
240
+ animations: "disabled",
241
+ caret: "hide",
242
+ scale: "css",
243
+ type: "png",
244
+ timeout: 5e3
245
+ });
246
+ let previous = await shoot();
247
+ for (let attempt = 0; attempt < 10; attempt += 1) {
248
+ const next = await shoot();
249
+ if (next.equals(previous)) return next;
250
+ previous = next;
251
+ }
252
+ }
253
+ /**
254
+ * Lists every font Chromium used for text under the capture container that is not an allowed
255
+ * web font. CDP reports the font file's internal family name, so the bundled "UF Test Sans" is
256
+ * allowed as "Inter" plus `isCustomFont`.
257
+ *
258
+ * It walks the pierced DOM tree, so it reaches what a selector cannot: user-agent shadow roots
259
+ * (a `<textarea>`'s text, an `<input>`'s value and placeholder) and generated content
260
+ * (`::before`, `::after`, a list marker).
261
+ */
262
+ async function fontAudit(page, marker) {
263
+ let session = cdpSessions.get(page);
264
+ if (!session) {
265
+ session = (async () => {
266
+ const cdp = await page.context().newCDPSession(page);
267
+ await cdp.send("DOM.enable");
268
+ await cdp.send("CSS.enable");
269
+ return cdp;
270
+ })();
271
+ cdpSessions.set(page, session);
272
+ }
273
+ const cdp = await session;
274
+ const { root } = await cdp.send("DOM.getDocument", {
275
+ depth: -1,
276
+ pierce: true
277
+ });
278
+ const containers = [];
279
+ const find = (node) => {
280
+ const attributes = node.attributes ?? [];
281
+ for (let index = 0; index < attributes.length; index += 2) if (attributes[index] === "data-uf-capture" && attributes[index + 1] === marker) {
282
+ containers.push(node);
283
+ return;
284
+ }
285
+ for (const child of [
286
+ ...node.children ?? [],
287
+ ...node.shadowRoots ?? [],
288
+ ...node.contentDocument ? [node.contentDocument] : []
289
+ ]) find(child);
290
+ };
291
+ find(root);
292
+ if (!containers.length) throw new Error(`[uf:visual] The font audit could not find the capture container ${marker}.`);
293
+ const elements = [];
294
+ const collect = (node, host) => {
295
+ let label = host;
296
+ if (node.nodeType === 1) {
297
+ label = node.pseudoType ? `${host}::${node.pseudoType}` : host ?? `<${node.localName}>`;
298
+ elements.push({
299
+ nodeId: node.nodeId,
300
+ label
301
+ });
302
+ }
303
+ for (const child of node.children ?? []) collect(child, host);
304
+ for (const shadow of node.shadowRoots ?? []) collect(shadow, label);
305
+ for (const pseudo of node.pseudoElements ?? []) collect(pseudo, label);
306
+ };
307
+ for (const container of containers) collect(container, void 0);
308
+ const violations = /* @__PURE__ */ new Set();
309
+ for (const { nodeId, label } of elements) {
310
+ const { fonts } = await cdp.send("CSS.getPlatformFontsForNode", { nodeId });
311
+ for (const font of fonts) {
312
+ if (font.isCustomFont && ALLOWED_FONTS.includes(font.familyName)) continue;
313
+ violations.add(`${label} rendered ${font.glyphCount} glyph(s) with "${font.familyName}"${font.isCustomFont ? "" : " (system font)"}`);
314
+ }
315
+ }
316
+ return [...violations];
317
+ }
318
+ /** The name of a target's browser project in this run, or none when the run leaves it out. */
319
+ function browserProjectOf(context, target) {
320
+ return context.project.vitest?.projects.find((project) => project.config.browser?.enabled === true && project.getProvidedContext().target === target)?.name;
321
+ }
322
+ function missingReference(reference, key, why) {
323
+ return `The reference target (${reference}) did not capture ${key} earlier in this run (${why}). The reference runs first (sequence.groupOrder) and must not be filtered out with --project.`;
324
+ }
325
+ function countDifferentPixels(a, b) {
326
+ let count = 0;
327
+ for (let index = 0; index < a.length; index += 4) if (a[index] !== b[index] || a[index + 1] !== b[index + 1] || a[index + 2] !== b[index + 2] || a[index + 3] !== b[index + 3]) count += 1;
328
+ return count;
329
+ }
330
+ /** Every box and computed-style difference, by element path. */
331
+ function diffGeometry(expected, actual) {
332
+ const deltas = [];
333
+ const paths = /* @__PURE__ */ new Set([...Object.keys(expected.nodes), ...Object.keys(actual.nodes)]);
334
+ for (const path of [...paths].sort()) {
335
+ const e = expected.nodes[path];
336
+ const a = actual.nodes[path];
337
+ if (!e || !a) {
338
+ deltas.push({
339
+ path,
340
+ property: "(node)",
341
+ expected: e ? "present" : "absent",
342
+ actual: a ? "present" : "absent"
343
+ });
344
+ continue;
345
+ }
346
+ if (JSON.stringify(e.box) !== JSON.stringify(a.box)) deltas.push({
347
+ path,
348
+ property: "box",
349
+ expected: e.box,
350
+ actual: a.box
351
+ });
352
+ const properties = /* @__PURE__ */ new Set([...Object.keys(e.style ?? {}), ...Object.keys(a.style ?? {})]);
353
+ for (const property of [...properties].sort()) if (e.style?.[property] !== a.style?.[property]) deltas.push({
354
+ path,
355
+ property,
356
+ expected: e.style?.[property],
357
+ actual: a.style?.[property]
358
+ });
359
+ }
360
+ return deltas;
361
+ }
362
+ /** Geometry deltas as message lines, the first `limit` of them. */
363
+ function formatGeometryDiff(deltas, against = "the reference", limit = 12) {
364
+ if (!deltas.length) return [];
365
+ const lines = deltas.slice(0, limit).map((delta) => ` ${delta.path} ${delta.property}: ${JSON.stringify(delta.expected)} → ${JSON.stringify(delta.actual)}`);
366
+ if (deltas.length > limit) lines.push(` … ${deltas.length - limit} more`);
367
+ return [`Geometry and computed styles differ from ${against} (${deltas.length}):`, ...lines];
368
+ }
369
+ //#endregion
370
+ export { ALLOWED_FONTS, baselineFileName, captureAt, caseCaptureLocation, diffGeometry, formatGeometryDiff, ufVisualCapture };