summaryrefslogtreecommitdiff
path: root/tests/wpt/wpt.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/wpt/wpt.ts')
-rwxr-xr-xtests/wpt/wpt.ts17
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/wpt/wpt.ts b/tests/wpt/wpt.ts
index 675ef3ae0..5fa56e41e 100755
--- a/tests/wpt/wpt.ts
+++ b/tests/wpt/wpt.ts
@@ -246,12 +246,12 @@ async function run() {
};
minifiedResults.push(minified);
}
- await Deno.writeTextFile(json, JSON.stringify(minifiedResults));
+ await Deno.writeTextFile(json, JSON.stringify(minifiedResults) + "\n");
}
if (wptreport) {
const report = await generateWptReport(results, startTime, endTime);
- await Deno.writeTextFile(wptreport, JSON.stringify(report));
+ await Deno.writeTextFile(wptreport, JSON.stringify(report) + "\n");
}
const code = reportFinal(results, endTime - startTime);
@@ -385,7 +385,7 @@ async function update() {
const endTime = new Date().getTime();
if (json) {
- await Deno.writeTextFile(json, JSON.stringify(results));
+ await Deno.writeTextFile(json, JSON.stringify(results) + "\n");
}
const resultTests: Record<
@@ -447,7 +447,7 @@ function insertExpectation(
assert(segment, "segments array must never be empty");
if (segments.length > 0) {
if (
- !currentExpectation[segment] ||
+ currentExpectation[segment] === undefined ||
Array.isArray(currentExpectation[segment]) ||
typeof currentExpectation[segment] === "boolean"
) {
@@ -459,7 +459,14 @@ function insertExpectation(
finalExpectation,
);
} else {
- currentExpectation[segment] = finalExpectation;
+ if (
+ currentExpectation[segment] === undefined ||
+ Array.isArray(currentExpectation[segment]) ||
+ typeof currentExpectation[segment] === "boolean" ||
+ (currentExpectation[segment] as { ignore: boolean })?.ignore !== true
+ ) {
+ currentExpectation[segment] = finalExpectation;
+ }
}
}