Public: anyone can read this; the crew can change it.

Every file renderer is fuzzed, or named as excluded with its reason: a renderer added without a sample fails the suite #14043

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/14042-every-file-renderer-is-fuzzed-or-named-a → main 3 commits fork

  • Merged. scout/14042-every-file-renderer-is-fuzzed-or-named-a was merged into main as 671b208.

Review

Sign in to review this change.
1 file changed +192 −49
test/fuzz-renderers.test.ts +192 −49
@@ -8,30 +8,14 @@
88 * to be kept in test/fuzz-found.test.ts.
99 */
1010 import { describe, expect, test } from "bun:test";
11 import type { Renderer } from "../src/web/render/renderers.ts";
12 import { csv } from "../src/web/render/csv.ts";
13 import { log } from "../src/web/render/log.ts";
14 import { ics } from "../src/web/render/ics.ts";
15 import { eml } from "../src/web/render/eml.ts";
16 import { vcf } from "../src/web/render/vcf.ts";
17 import { gpx } from "../src/web/render/gpx.ts";
18 import { dxf } from "../src/web/render/dxf.ts";
19 import { drawio, excalidraw, mermaid } from "../src/web/render/diagram.ts";
20 import { geojson } from "../src/web/render/geojson.ts";
21 import { subtitles } from "../src/web/render/subtitles.ts";
22 import { patch } from "../src/web/render/patch.ts";
23 import { notebook } from "../src/web/render/notebook.ts";
24 import { makefile } from "../src/web/render/makefile.ts";
25 import { lcov } from "../src/web/render/lcov.ts";
26 import { sarif } from "../src/web/render/sarif.ts";
27 import { gcode } from "../src/web/render/gcode.ts";
28 import { config } from "../src/web/render/config.ts";
29 import { markdown } from "../src/web/render/markdown.ts";
11 import { RENDERERS, type Renderer } from "../src/web/render/renderers.ts";
3012 import { fuzz, int, mix, pick, rng, type Rand } from "./helpers/fuzz.ts";
3113 import { blobBody, rawResponse } from "../src/web/pages/repo.ts";
3214 import { fileKind, HEAD_BYTES, mediaType, RENDER_CAP, sniffType, TEXT_CAP } from "../src/web/render/kinds.ts";
3315 import { securityFloor } from "../src/http/respond.ts";
3416
17 const encoder = new TextEncoder();
18
3519 /** What a hostile file tries to smuggle into the page. */
3620 export const HOSTILE = [
3721 "<script>alert(1)</script>",
@@ -62,22 +46,23 @@ export const HOSTILE = [
6246 "x".repeat(5000),
6347 ];
6448
65 /** A valid file of each kind; a case is one of these with hostile text spliced in. */
66 const SAMPLES: Record<string, { path: string; render: Renderer; files: readonly string[] }> = {
49 /**
50 * A valid file of each kind; a case is one of these with hostile text spliced in. The kind is what
51 * `fileKind` reads from the path and the first file, and the renderer fuzzed is the one `RENDERERS`
52 * names for it: the one the blob page draws with.
53 */
54 export const SAMPLES: Readonly<Record<string, { path: string; files: readonly string[] }>> = {
6755 csv: {
6856 path: "data.csv",
69 render: csv,
7057 files: ['name,url,note\nAda,https://a.test,"quoted, cell"\nBob,javascript:alert(1),x\n'],
7158 },
72 tsv: { path: "data.tsv", render: csv, files: ["a\tb\tc\n1\t2\t3\n"] },
59 tsv: { path: "data.tsv", files: ["a\tb\tc\n1\t2\t3\n"] },
7360 jsonl: {
7461 path: "rows.jsonl",
75 render: csv,
7662 files: ['{"a":1,"b":"<b>x</b>"}\n{"a":2,"href":"javascript:alert(1)"}\n'],
7763 },
7864 log: {
7965 path: "build.log",
80 render: log,
8166 files: [
8267 "\u001b[1;32mok\u001b[0m step one\n\u001b[38;5;196mfail\u001b[0m\n\u001b]8;;https://a.test\u0007link\u001b]8;;\u0007\n",
8368 "INFO start\nWARN slow\nERROR boom\nFATAL end\n",
@@ -85,129 +70,265 @@ const SAMPLES: Record<string, { path: string; render: Renderer; files: readonly
8570 },
8671 ics: {
8772 path: "cal.ics",
88 render: ics,
8973 files: [
9074 "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nBEGIN:VEVENT\r\nSUMMARY:Meet\r\nDTSTART:20260101T100000Z\r\nDTEND:20260101T110000Z\r\nLOCATION:Room 1\r\nURL:https://a.test/\r\nDESCRIPTION:Line\\nTwo\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n",
9175 ],
9276 },
9377 vcf: {
9478 path: "people.vcf",
95 render: vcf,
9679 files: [
9780 "BEGIN:VCARD\r\nVERSION:3.0\r\nFN:Ada Lovelace\r\nEMAIL:[email protected]\r\nTEL:+1 555\r\nURL:https://a.test/\r\nORG:Engines\r\nNOTE:hi\r\nEND:VCARD\r\n",
9881 ],
9982 },
10083 eml: {
10184 path: "mail.eml",
102 render: eml,
10385 files: [
10486 "From: Ada <[email protected]>\r\nSubject: =?utf-8?Q?<script>?=\r\nMIME-Version: 1.0\r\nContent-Type: text/html\r\n\r\n<p onclick=x>hi</p>\r\n",
10587 ],
10688 },
10789 gpx: {
10890 path: "track.gpx",
109 render: gpx,
11091 files: [
11192 '<?xml version="1.0"?><gpx version="1.1" creator="x"><metadata><name>Walk</name><link href="https://a.test"/></metadata><trk><name>T</name><trkseg><trkpt lat="51.5" lon="-0.1"><ele>10</ele><time>2026-01-01T10:00:00Z</time></trkpt><trkpt lat="51.6" lon="-0.2"><ele>12</ele></trkpt></trkseg></trk><wpt lat="51.5" lon="-0.1"><name>W</name><desc>d</desc></wpt></gpx>',
11293 ],
11394 },
11495 dxf: {
11596 path: "part.dxf",
116 render: dxf,
11797 files: ["0\nSECTION\n2\nENTITIES\n0\nLINE\n8\n<script>alert(1)</script>\n10\n0\n20\n0\n11\n5\n21\n5\n0\nCIRCLE\n10\n1\n20\n1\n40\n2\n0\nENDSEC\n0\nEOF\n"],
11898 },
11999 drawio: {
120100 path: "a.drawio",
121 render: drawio,
122101 files: [
123102 `<mxfile><diagram><mxGraphModel><root><mxCell id="2" value="<script>alert(1)</script>" style="ellipse;" vertex="1"><mxGeometry x="1" y="2" width="30" height="40"/></mxCell><mxCell id='3' value="b" vertex="1"><mxGeometry x="90" y="9" width="30" height="40"/></mxCell><mxCell id="4" edge="1" source="2" target="3"><mxGeometry><mxPoint x="5" y="5"/></mxGeometry></mxCell></root></mxGraphModel></diagram></mxfile>`,
124103 ],
125104 },
126105 excalidraw: {
127106 path: "a.excalidraw",
128 render: excalidraw,
129107 files: ['{"elements":[{"type":"rectangle","x":0,"y":0,"width":9,"height":9},{"type":"text","x":1,"y":1,"text":"<script>a</script>\\nb","fontSize":20},{"type":"arrow","x":0,"y":0,"points":[[0,0],[5,5]]}]}'],
130108 },
131109 mermaid: {
132110 path: "a.mmd",
133 render: mermaid,
134111 files: ["---\ntitle: <b>x</b>\n---\nflowchart TD\n A[<script>alert(1)</script>] --> B\n"],
135112 },
136113 geojson: {
137114 path: "map.geojson",
138 render: geojson,
139115 files: [
140116 '{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"name":"A","url":"javascript:alert(1)"},"geometry":{"type":"Point","coordinates":[0.1,51.5]}},{"type":"Feature","properties":{"k":"v"},"geometry":{"type":"LineString","coordinates":[[0,0],[1,1]]}}]}',
141117 ],
142118 },
143119 sarif: {
144120 path: "scan.sarif",
145 render: sarif,
146121 files: ['{"version":"2.1.0","runs":[{"tool":{"driver":{"name":"T"}},"results":[{"ruleId":"R","level":"error","message":{"text":"m"},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"src/a.ts"},"region":{"startLine":3}}}]}]}]}'],
147122 },
148123 lcov: {
149124 path: "lcov.info",
150 render: lcov,
151125 files: ["TN:\nSF:src/a.ts\nFNF:2\nFNH:1\nDA:1,1\nDA:2,0\nLF:2\nLH:1\nBRF:4\nBRH:2\nend_of_record\n"],
152126 },
153127 makefile: {
154128 path: "Makefile",
155 render: makefile,
156129 files: [".PHONY: all clean\nCC := <b>gcc</b>\nall: a.o | dir\n\t$(CC) -o x \\\n\t a.o\nclean:\n\trm -f *.o\ninclude <script>.mk\n"],
157130 },
158131 srt: {
159132 path: "talk.srt",
160 render: subtitles,
161133 files: ["1\n00:00:01,000 --> 00:00:02,000\n<i>Hello</i> there\n\n2\n00:00:03,000 --> 00:00:04,500\n<b>Bye</b>\n"],
162134 },
163135 vtt: {
164136 path: "talk.vtt",
165 render: subtitles,
166137 files: ["WEBVTT\n\n00:00:01.000 --> 00:00:02.000\n<v Ada>Hello <c.x>there</c>\n\nNOTE x\n\n00:00:03.000 --> 00:00:04.000 align:start\nBye\n"],
167138 },
168139 patch: {
169140 path: "fix.patch",
170 render: patch,
171141 files: [
172142 "From abc Mon Sep 17 00:00:00 2001\nFrom: Ada <[email protected]>\nSubject: [PATCH] fix\n\n---\ndiff --git a/x.ts b/x.ts\nindex 1..2 100644\n--- a/x.ts\n+++ b/x.ts\n@@ -1,2 +1,2 @@\n-old\n+new\n context\n",
173143 ],
174144 },
175145 notebook: {
176146 path: "nb.ipynb",
177 render: notebook,
178147 files: [
179148 '{"nbformat":4,"nbformat_minor":5,"metadata":{"kernelspec":{"name":"python3","language":"python"}},"cells":[{"cell_type":"markdown","source":["# Title\\n","[x](https://a.test)"]},{"cell_type":"code","execution_count":1,"source":"print(1)","outputs":[{"output_type":"stream","name":"stdout","text":["1\\n"]},{"output_type":"execute_result","data":{"text/html":["<b>x</b>"],"text/plain":["x"],"image/png":"iVBORw0KGgo="}},{"output_type":"error","ename":"E","evalue":"v","traceback":["\\u001b[31mE\\u001b[0m"]}]}]}',
180149 ],
181150 },
182151 gcode: {
183152 path: "part.gcode",
184 render: gcode,
185153 files: [";FLAVOR:Marlin\n;LAYER:0\nG28\nG1 Z0.2 F300\nG1 X10 Y10 E1 F1200\nG1 X20 Y10 E2\n;LAYER:1\nG1 Z0.4\nG1 X20 Y20 E3\nM104 S200 ; <b>hot</b>\n"],
186154 },
187155 json: {
188156 path: "settings.json",
189 render: config,
190157 files: ['{"name":"x","port":8080,"debug":true,"tags":["a","b"],"nested":{"url":"javascript:alert(1)","n":null}}'],
191158 },
192159 yaml: {
193160 path: "settings.yaml",
194 render: config,
195161 files: ["name: x\nport: 8080\ntags:\n - a\n - b\nnested:\n url: \"javascript:alert(1)\"\n"],
196162 },
197163 toml: {
198164 path: "settings.toml",
199 render: config,
200165 files: ['name = "x"\nport = 8080\n[nested]\nurl = "javascript:alert(1)"\n'],
201166 },
202167 markdown: {
203168 path: "docs/README.md",
204 render: markdown,
205169 files: [
206170 "# Title\n\nSome *text* and a [link](https://a.test) and ![img](pic.png).\n\n```js\ncode()\n```\n\n| a | b |\n|---|---|\n| 1 | 2 |\n\n<details><summary>x</summary>y</details>\n",
207171 ],
208172 },
173 env: {
174 path: ".env.example",
175 files: ["# Server\n\n# the port\nPORT=8080\nAPI_SECRET=hunter2 # never\nURL=\"javascript:alert(1)\"\n"],
176 },
177 sql: {
178 path: "schema.sql",
179 files: [
180 "-- users\nCREATE TABLE users (\n id INTEGER PRIMARY KEY,\n name TEXT NOT NULL DEFAULT '<b>x</b>'\n);\nINSERT INTO users VALUES (1, 'a;b');\n",
181 ],
182 },
183 graphql: {
184 path: "schema.graphql",
185 files: ["# c\ntype Query {\n user(id: ID!): User\n}\ntype User {\n name: String\n}\nenum Role { A B }\nunion X = User\n"],
186 },
187 mbox: {
188 path: "inbox.mbox",
189 files: [
190 "From [email protected] Mon Jan 1 00:00:00 2024\nFrom: Ann <[email protected]>\nSubject: =?UTF-8?B?aGVsbG8=?=\n <b>world</b>\nDate: Mon, 1 Jan 2024\n\n>From body line\n\nFrom [email protected] Tue\nFrom: Bob\nSubject: two\n\nx\n",
191 ],
192 },
193 proto: {
194 path: "user.proto",
195 files: [
196 '// c\nsyntax = "proto3";\npackage demo.v1;\nimport "other.proto";\nmessage User {\n string name = 1; // <b>x</b>\n repeated int32 ids = 2 [packed = true];\n map<string, Role> roles = 3;\n oneof pick { string a = 4; int32 b = 5; }\n reserved 9, 10;\n message Inner { bool ok = 1; }\n}\nenum Role { OTHER = 0; ADMIN = 1 [deprecated = true]; }\nservice Users {\n rpc Get (GetReq) returns (User);\n rpc Watch (stream GetReq) returns (stream User) { option deprecated = true; }\n}\n',
197 ],
198 },
199 openapi: {
200 path: "openapi.json",
201 files: [
202 '{"openapi":"3.0.0","info":{"title":"<b>T</b>","version":"1"},"paths":{"/a":{"get":{"tags":["t"],"summary":"s","deprecated":true}},"/b":{"post":{"summary":"javascript:alert(1)"}}}}',
203 ],
204 },
205 package: {
206 path: "package.json",
207 files: [
208 '{"name":"x","version":"1.0.0","type":"module","license":"MIT","scripts":{"test":"bun test"},"dependencies":{"a":"^1"},"devDependencies":{"b":"javascript:alert(1)"}}',
209 ],
210 },
211 dockerfile: {
212 path: "Dockerfile",
213 files: ["ARG V=1\nFROM oven/bun:1 AS build\nENV SECRET=x\nEXPOSE 3000\nRUN echo <b>x</b> \\\n && true\nCOPY . .\nFROM scratch\nCMD [\"x\"]\n"],
214 },
215 workflow: {
216 path: ".github/workflows/ci.yml",
217 files: [
218 "on: [push]\njobs:\n test:\n runs-on: ubuntu-latest\n needs: []\n strategy:\n matrix:\n os: [a, b]\n steps:\n - uses: actions/checkout@v4\n - name: <b>run</b>\n run: bun test\n",
219 ],
220 },
221 compose: {
222 path: "compose.yaml",
223 files: [
224 "services:\n web:\n image: nginx\n ports: [\"80:80\"]\n volumes: [\"./a:/a\"]\n depends_on: [db]\n environment:\n SECRET: x\n db:\n build: ./db\n",
225 ],
226 },
227 kml: {
228 path: "places.kml",
229 files: [
230 '<?xml version="1.0"?><kml xmlns="http://www.opengis.net/kml/2.2"><Document><Placemark><name>A</name><description>&lt;b&gt;x&lt;/b&gt;</description><Point><coordinates>-0.1,51.5,0</coordinates></Point></Placemark></Document></kml>',
231 ],
232 },
233 har: {
234 path: "session.har",
235 files: [
236 '{"log":{"version":"1.2","entries":[{"startedDateTime":"2026-01-01T10:00:00.000Z","time":50,"request":{"method":"GET","url":"https://a.test/","headers":[{"name":"x","value":"<b>y</b>"}]},"response":{"status":200,"statusText":"OK","headers":[],"content":{"size":10}},"timings":{"wait":20,"receive":30}}]}}',
237 ],
238 },
239 otio: {
240 path: "cut.otio",
241 files: [
242 '{"OTIO_SCHEMA":"Timeline.1","name":"T","tracks":{"OTIO_SCHEMA":"Stack.1","children":[{"OTIO_SCHEMA":"Track.1","name":"V1","kind":"Video","children":[{"OTIO_SCHEMA":"Clip.2","name":"<b>c</b>","source_range":{"OTIO_SCHEMA":"TimeRange.1","start_time":{"OTIO_SCHEMA":"RationalTime.1","value":0,"rate":24},"duration":{"OTIO_SCHEMA":"RationalTime.1","value":48,"rate":24}}}]}]}}',
243 ],
244 },
245 edl: {
246 path: "cut.edl",
247 files: [
248 "TITLE: <b>T</b>\nFCM: NON-DROP FRAME\n\n001 AX V C 00:00:00:00 00:00:02:00 01:00:00:00 01:00:02:00\n* FROM CLIP NAME: a.mov\n",
249 ],
250 },
251 fcpxml: {
252 path: "cut.fcpxml",
253 files: [
254 '<?xml version="1.0"?><fcpxml version="1.9"><resources><format id="r1" frameDuration="1/24s"/><asset id="r2" name="A" src="file:///a.mov"/></resources><library><event><project name="P"><sequence format="r1"><spine><asset-clip ref="r2" name="&lt;b&gt;c&lt;/b&gt;" offset="0s" start="0s" duration="2s"/></spine></sequence></project></event></library></fcpxml>',
255 ],
256 },
257 junit: {
258 path: "results.junit.xml",
259 files: [
260 '<?xml version="1.0"?><testsuites tests="2" failures="1"><testsuite name="S" tests="2" failures="1" time="0.1"><testcase name="ok" classname="C" time="0.01"/><testcase name="bad" classname="C"><failure message="&lt;b&gt;m&lt;/b&gt;">trace\nline</failure></testcase></testsuite></testsuites>',
261 ],
262 },
263 opml: {
264 path: "subs.opml",
265 files: [
266 '<?xml version="1.0"?><opml version="2.0"><head><title>Subs</title></head><body><outline text="A" xmlUrl="https://a.test/feed"/><outline text="B" htmlUrl="javascript:alert(1)"/></body></opml>',
267 ],
268 },
269 feed: {
270 path: "news.rss",
271 files: [
272 '<?xml version="1.0"?><rss version="2.0"><channel><title>N</title><item><title>&lt;b&gt;x&lt;/b&gt;</title><link>https://a.test/1</link><pubDate>Thu, 01 Jan 2026 10:00:00 GMT</pubDate></item><item><title>J</title><link>javascript:alert(1)</link></item></channel></rss>',
273 ],
274 },
275 step: {
276 path: "part.step",
277 files: [
278 "ISO-10303-21;\nHEADER;\nFILE_DESCRIPTION(('<b>d</b>'),'2;1');\nFILE_NAME('part.step','2026-01-01',('Ada'),(''),'','','');\nFILE_SCHEMA(('AUTOMOTIVE_DESIGN'));\nENDSEC;\nDATA;\n#1=PRODUCT('P','<script>','',(#2));\n#2=CARTESIAN_POINT('',(0.,0.,0.));\nENDSEC;\nEND-ISO-10303-21;\n",
279 ],
280 },
281 model3d: {
282 path: "cube.obj",
283 files: ["# <b>cube</b>\no Cube\nv 0 0 0\nv 1 0 0\nv 0 1 0\nvn 0 0 1\nf 1 2 3\n"],
284 },
209285 };
210286
287 /**
288 * Kinds the fuzz does not draw from generated text, each with why. A kind here draws no byte of the
289 * file into the page (the media route serves it under its own policy), or reads a binary format a
290 * generator cannot splice text into without a fixture to start from.
291 */
292 export const EXCLUDED: Readonly<Record<string, string>> = {
293 image: "an <img> pointing at the media route; only the header's width and height are read",
294 svg: "an <img> pointing at the media route, served under a sandbox policy; no byte enters the page",
295 pdf: "a viewer pointing at the media route; no byte enters the page",
296 html: "a sandboxed <iframe> pointing at the media route; no byte enters the page",
297 audio: "an <audio> pointing at the media route; binary, needs a fixture",
298 video: "a <video> pointing at the media route; binary, needs a fixture",
299 sqlite: "binary database pages; needs a fixture to splice into",
300 parquet: "binary columnar file; needs a fixture to splice into",
301 archive: "zip/tar bytes; needs a fixture to splice into",
302 sheet: "a zip of XML (xlsx); needs a fixture to splice into",
303 document: "a zip of XML (docx); needs a fixture to splice into",
304 slides: "a zip of XML (pptx); needs a fixture to splice into",
305 layers: "a zip of images (ora); needs a fixture to splice into",
306 font: "binary font tables; needs a fixture to splice into",
307 psd: "binary Photoshop layers; needs a fixture to splice into",
308 };
309
310 /** The kind a sample is: what the blob page reads from its path and first file. */
311 export const sampleKind = (sample: { path: string; files: readonly string[] }): string =>
312 fileKind(sample.path, encoder.encode(sample.files[0] ?? "").subarray(0, HEAD_BYTES));
313
314 /**
315 * The kinds a registry draws that are neither sampled nor excluded, with a message naming each and
316 * where to add it; empty when every kind is accounted for.
317 */
318 export function unguarded(
319 registry: Readonly<Record<string, unknown>>,
320 sampled: ReadonlySet<string>,
321 excluded: Readonly<Record<string, string>>,
322 ): string[] {
323 return Object.keys(registry)
324 .filter((kind) => !sampled.has(kind) && !(kind in excluded))
325 .map(
326 (kind) =>
327 `renderer "${kind}" is not fuzzed: add a valid file of it to SAMPLES in test/fuzz-renderers.test.ts, ` +
328 `or a line to EXCLUDED there saying why it cannot be`,
329 );
330 }
331
211332 /** One case: a sample cut at random places with hostile pieces put in. */
212333 const caseFor =
213334 (files: readonly string[]) =>
@@ -254,7 +375,6 @@ export function assertInert(html: string): void {
254375 }
255376 }
256377
257 const encoder = new TextEncoder();
258378
259379 describe("fuzz: file renderers", () => {
260380 test("the inertness check catches what it is for", () => {
@@ -273,11 +393,34 @@ describe("fuzz: file renderers", () => {
273393 );
274394 });
275395
396 test("every kind RENDERERS draws is sampled here or excluded with its reason", () => {
397 const sampled = new Set(Object.values(SAMPLES).map(sampleKind));
398 expect(unguarded(RENDERERS, sampled, EXCLUDED)).toEqual([]);
399 // An exclusion for a kind that is sampled, or that no longer exists, is stale.
400 expect(Object.keys(EXCLUDED).filter((k) => sampled.has(k) || !(k in RENDERERS))).toEqual([]);
401 for (const reason of Object.values(EXCLUDED)) expect(reason.trim().length).toBeGreaterThan(0);
402 });
403
404 test("the guard names a kind whose sample is taken away, and where to add it", () => {
405 const stub: Record<string, Renderer> = { csv: RENDERERS.csv!, log: RENDERERS.log!, font: RENDERERS.font! };
406 const both = new Set(["csv", "log"]);
407 expect(unguarded(stub, both, { font: "binary" })).toEqual([]);
408 const missing = unguarded(stub, new Set(["csv"]), { font: "binary" });
409 expect(missing).toHaveLength(1);
410 expect(missing[0]).toContain('"log"');
411 expect(missing[0]).toContain("SAMPLES in test/fuzz-renderers.test.ts");
412 expect(unguarded(stub, both, {})[0]).toContain('"font"');
413 });
414
276415 for (const [name, sample] of Object.entries(SAMPLES))
277416 test(`${name}: never throws, never lets a tag or a javascript: URL through`, async () => {
417 const kind = sampleKind(sample);
418 const render = RENDERERS[kind as keyof typeof RENDERERS];
419 if (render === undefined) throw new Error(`${sample.path} reads as "${kind}", which no renderer draws`);
278420 // The valid sample itself draws, so the cases built on it reach the drawing.
279421 for (const file of sample.files) {
280 const out = sample.render(input(sample.path, file));
422 const out = render(input(sample.path, file));
423 expect(out.fallback).toBeUndefined();
281424 expect(out.content.text.length).toBeGreaterThan(0);
282425 }
283426 await fuzz(
@@ -285,7 +428,7 @@ describe("fuzz: file renderers", () => {
285428 caseFor(sample.files),
286429 (text) => {
287430 const all = text.length % 2 === 0;
288 const out = sample.render(input(sample.path, text, all));
431 const out = render(input(sample.path, text, all));
289432 assertInert(out.content.text);
290433 },
291434 Math.min(Number(process.env["FUZZ_RUNS"] ?? 250), 250),

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs