mirror of
https://github.com/versia-pub/api.git
synced 2026-03-13 04:09:15 +01:00
feat(federation): ✨ Improve federation module
This commit is contained in:
parent
e0b6d57470
commit
407e57fe34
10 changed files with 382 additions and 116 deletions
|
|
@ -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(),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue