mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-08-14 23:07:29 +00:00
Scaffold LogicSRC and CommandBoard plugins
This commit is contained in:
parent
59927e140c
commit
5c9ea821f6
67 changed files with 5958 additions and 0 deletions
28
packages/validators/src/index.test.ts
Normal file
28
packages/validators/src/index.test.ts
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import { readFileSync } from "node:fs";
|
||||
import { dirname, resolve } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { parseDocument, validate } from "./index.js";
|
||||
|
||||
describe("LogicSRC validators", () => {
|
||||
it("validates the task fixture", () => {
|
||||
const testDir = dirname(fileURLToPath(import.meta.url));
|
||||
const file = resolve(testDir, "../../schemas/fixtures/task.yaml");
|
||||
const data = parseDocument(readFileSync(file, "utf8"), file);
|
||||
|
||||
expect(validate("task", data).ok).toBe(true);
|
||||
});
|
||||
|
||||
it("rejects a task without a DID", () => {
|
||||
const result = validate("task", {
|
||||
type: "logicsrc.task",
|
||||
version: "0.1",
|
||||
title: "Missing DID",
|
||||
description: "This should fail.",
|
||||
board: "/qa",
|
||||
status: "open"
|
||||
});
|
||||
|
||||
expect(result.ok).toBe(false);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue