diff options
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/wpt.ts | 18 | ||||
| -rw-r--r-- | tools/wpt/utils.ts | 3 |
2 files changed, 18 insertions, 3 deletions
diff --git a/tools/wpt.ts b/tools/wpt.ts index 13f8b6467..203b198d1 100755 --- a/tools/wpt.ts +++ b/tools/wpt.ts @@ -165,7 +165,7 @@ async function run() { const result = await runSingleTest( test.url, test.options, - json ? () => {} : createReportTestCase(test.expectation), + createReportTestCase(test.expectation), ); results.push({ test, result }); reportVariation(result, test.expectation); @@ -175,7 +175,21 @@ async function run() { }); if (json) { - await Deno.writeTextFile(json, JSON.stringify(results)); + const minifiedResults = []; + for (const result of results) { + const minified = { + file: result.test.path, + name: + Object.fromEntries(result.test.options.script_metadata ?? []).title ?? + null, + cases: result.result.cases.map((case_) => ({ + name: case_.name, + passed: case_.passed, + })), + }; + minifiedResults.push(minified); + } + await Deno.writeTextFile(json, JSON.stringify(minifiedResults)); } const code = reportFinal(results); Deno.exit(code); diff --git a/tools/wpt/utils.ts b/tools/wpt/utils.ts index 6d982068b..cb454300b 100644 --- a/tools/wpt/utils.ts +++ b/tools/wpt/utils.ts @@ -38,7 +38,8 @@ export type ManifestTestVariation = [ options: ManifestTestOptions, ]; export interface ManifestTestOptions { - name?: string; + // deno-lint-ignore camelcase + script_metadata: [string, string][]; } const MANIFEST_PATH = join(ROOT_PATH, "./tools/wpt/manifest.json"); |
