Add a "wpt" dump mode

Adds a not-documented "wpt" mode to --dump which outputs a formatted
report.cases.

This is meant to make working on a single WPT test case easier, particularly
with some coding tool. Claude recommended this output for its own use.

Instead of telling claude to start the browser in serve mode, then run the
wptrunner, and merge the two outputs (and then stop the server), you can do:

zig build run -- fetch --dump wpt "http://localhost:8000/dom/nodes/CharacterData-appendChild.html"

(you still need the wpt server up)
This commit is contained in:
Karl Seguin
2026-02-28 19:08:58 +08:00
parent 0a9e5b66ee
commit 45196e022b
2 changed files with 52 additions and 0 deletions

View File

@@ -185,6 +185,7 @@ pub const Serve = struct {
pub const DumpFormat = enum {
html,
markdown,
wpt,
};
pub const Fetch = struct {