WF
This commit is contained in:
parent
3dd5e3c4f1
commit
c981be9229
@ -6,10 +6,11 @@ import { Metadata } from "@/lib/types";
|
|||||||
console.log('Current directory: ' + process.cwd());
|
console.log('Current directory: ' + process.cwd());
|
||||||
const jsonDir = "../json";
|
const jsonDir = "../json";
|
||||||
const metadataFileName = "metadata.json";
|
const metadataFileName = "metadata.json";
|
||||||
|
const versionsFileName = "versions.json";
|
||||||
const encoding = "utf-8";
|
const encoding = "utf-8";
|
||||||
|
|
||||||
const fileNames = (await fs.readdir(jsonDir))
|
const fileNames = (await fs.readdir(jsonDir))
|
||||||
.filter((fileName) => fileName !== metadataFileName)
|
.filter((fileName) => fileName !== metadataFileName && fileName !== versionsFileName);
|
||||||
|
|
||||||
describe.each(fileNames)("%s", async (fileName) => {
|
describe.each(fileNames)("%s", async (fileName) => {
|
||||||
let script: Script;
|
let script: Script;
|
||||||
@ -20,7 +21,6 @@ describe.each(fileNames)("%s", async (fileName) => {
|
|||||||
script = JSON.parse(fileContent);
|
script = JSON.parse(fileContent);
|
||||||
})
|
})
|
||||||
|
|
||||||
if (fileName === "versions.json") return;
|
|
||||||
|
|
||||||
it("should have valid json according to script schema", () => {
|
it("should have valid json according to script schema", () => {
|
||||||
ScriptSchema.parse(script);
|
ScriptSchema.parse(script);
|
||||||
@ -42,7 +42,6 @@ describe(`${metadataFileName}`, async () => {
|
|||||||
const fileContent = await fs.readFile(filePath, encoding)
|
const fileContent = await fs.readFile(filePath, encoding)
|
||||||
metadata = JSON.parse(fileContent);
|
metadata = JSON.parse(fileContent);
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should have valid json according to metadata schema", () => {
|
it("should have valid json according to metadata schema", () => {
|
||||||
// TODO: create zod schema for metadata. Move zod schemas to /lib/types.ts
|
// TODO: create zod schema for metadata. Move zod schemas to /lib/types.ts
|
||||||
assert(metadata.categories.length > 0);
|
assert(metadata.categories.length > 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user