mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 20:37:21 +00:00
* reorganized storage adapter and added test suites for adapter and fields * added build command in ci pipeline * updated workflow to also run node tests * updated workflow: try with separate tasks * updated workflow: try with separate tasks * updated workflow: added tsx as dev dependency * updated workflow: try with find instead of glob
16 lines
662 B
TypeScript
16 lines
662 B
TypeScript
import { describe, expect, test } from "bun:test";
|
|
import { TextField } from "../../../../src/data";
|
|
import { fieldTestSuite, transformPersist } from "data/fields/field-test-suite";
|
|
|
|
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({ expect, test }, TextField, { defaultValue: "abc", schemaType: "text" });
|
|
});
|