feat(federation): Improve federation module

This commit is contained in:
Jesse Wierzbinski 2024-05-14 09:08:46 -10:00
parent e0b6d57470
commit 407e57fe34
No known key found for this signature in database
10 changed files with 382 additions and 116 deletions

View file

@ -1,12 +1,19 @@
import { describe, expect, it } from "bun:test";
import { Note } from "../schemas/base";
import type { ValidationError } from "zod-validation-error";
import { EntityValidator } from "../index";
describe("Package testing", () => {
it("should not validate a bad Note", () => {
it("should not validate a bad Note", async () => {
const badObject = {
IamBad: "Note",
};
expect(Note.parseAsync(badObject)).rejects.toThrow();
const validator = new EntityValidator();
expect(validator.Note(badObject)).rejects.toThrow();
console.log(
(await validator.Note(badObject).catch((e) => e)).toString(),
);
});
});