mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-02 08:06:00 +00:00
ca55503e66
* refactored core and core/utils imports * refactored core and core/utils imports * refactored media imports * refactored auth imports * refactored data imports * updated package json exports, fixed mm config * fix tests
17 lines
700 B
TypeScript
17 lines
700 B
TypeScript
import { describe, expect, test } from "bun:test";
|
|
import { TextField } from "data/fields";
|
|
import { fieldTestSuite, transformPersist } from "data/fields/field-test-suite";
|
|
import { bunTestRunner } from "adapter/bun/test";
|
|
|
|
describe("[data] TextField", async () => {
|
|
test("transformPersist (config)", async () => {
|
|
const field = new TextField("test", { minLength: 3, maxLength: 5 });
|
|
|
|
expect(transformPersist(field, "a")).rejects.toThrow();
|
|
expect(transformPersist(field, "abcdefghijklmn")).rejects.toThrow();
|
|
expect(transformPersist(field, "abc")).resolves.toBe("abc");
|
|
});
|
|
|
|
fieldTestSuite(bunTestRunner, TextField, { defaultValue: "abc", schemaType: "text" });
|
|
});
|