Compare commits

..

1 Commits

Author SHA1 Message Date
t.behrendt 498601b81a refactor: to node action
CI / Test (pull_request) Failing after 10s
CI / Check Dist (pull_request) Successful in 10s
CI / Dry-Run (pull_request) Failing after 1m1s
2026-06-27 13:42:35 +02:00
+10 -10
View File
@@ -31,7 +31,7 @@ describe("validateJson()", () => {
despiteThisBeingValidJson: "toString() breaks it, making it invalid", despiteThisBeingValidJson: "toString() breaks it, making it invalid",
}.toString(); }.toString();
await expect(validateJson(jsonFile)).rejects.toThrow( await expect(validateJson(jsonFile)).rejects.toThrow(
'"[object Object]" is not valid JSON', '"[object Object]" is not valid JSON'
); );
}); });
@@ -40,7 +40,7 @@ describe("validateJson()", () => {
validJson: true, validJson: true,
}); });
await expect(validateJson(jsonFile)).rejects.toThrow( await expect(validateJson(jsonFile)).rejects.toThrow(
"No schema found in JSON file.", "No schema found in JSON file."
); );
}); });
@@ -48,7 +48,7 @@ describe("validateJson()", () => {
vi.mocked(fetch).mockRejectedValue(new Error("Failed to fetch schema")); vi.mocked(fetch).mockRejectedValue(new Error("Failed to fetch schema"));
const jsonFile = JSON.stringify({ $schema: "http://t00n.de/404.json" }); const jsonFile = JSON.stringify({ $schema: "http://t00n.de/404.json" });
await expect(validateJson(jsonFile)).rejects.toThrow( await expect(validateJson(jsonFile)).rejects.toThrow(
"Failed to fetch schema", "Failed to fetch schema"
); );
}); });
@@ -58,18 +58,18 @@ describe("validateJson()", () => {
{ {
ok: true, ok: true,
text: async () => text: async () =>
JSON.stringify({ ({
despiteThisBeingValidJson: despiteThisBeingValidJson:
"toString() breaks it, making it invalid", "toString() breaks it, making it invalid",
}), }.toString()),
}, }
); );
const jsonFile = JSON.stringify({ const jsonFile = JSON.stringify({
$schema: "https://json-schema.org/draft-07/schema", $schema: "https://json-schema.org/draft-07/schema",
}); });
await expect(validateJson(jsonFile)).rejects.toThrow( await expect(validateJson(jsonFile)).rejects.toThrow(
'strict mode: unknown keyword: "despiteThisBeingValidJson"', '"[object Object]" is not valid JSON'
); );
}); });
@@ -79,7 +79,7 @@ describe("validateJson()", () => {
{ {
ok: true, ok: true,
text: async () => validSchema, text: async () => validSchema,
}, }
); );
const jsonFile = JSON.stringify({ const jsonFile = JSON.stringify({
@@ -87,7 +87,7 @@ describe("validateJson()", () => {
notTheExpectedField: 42, notTheExpectedField: 42,
}); });
await expect(validateJson(jsonFile)).rejects.toThrow( await expect(validateJson(jsonFile)).rejects.toThrow(
"JSON file is not valid: No errors", "JSON file is not valid: No errors"
); );
}); });
@@ -97,7 +97,7 @@ describe("validateJson()", () => {
{ {
ok: true, ok: true,
text: async () => validSchema, text: async () => validSchema,
}, }
); );
const jsonFile = JSON.stringify({ const jsonFile = JSON.stringify({