mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
Updated the package version to 0.18.0-rc.4. Improved test logging by disabling console output during tests to reduce noise and enhance readability. Adjusted various test files to implement console log management, ensuring cleaner test outputs.
28 lines
880 B
TypeScript
28 lines
880 B
TypeScript
import { afterAll, beforeAll, describe, expect, it } from "bun:test";
|
|
import { createApp } from "core/test/utils";
|
|
import { Api } from "../../src/Api";
|
|
import { disableConsoleLog, enableConsoleLog } from "core/utils/test";
|
|
|
|
beforeAll(disableConsoleLog);
|
|
afterAll(enableConsoleLog);
|
|
|
|
describe("integration config", () => {
|
|
it("should create an entity", async () => {
|
|
const app = createApp();
|
|
await app.build();
|
|
const api = new Api({
|
|
host: "http://localhost",
|
|
fetcher: app.server.request as typeof fetch,
|
|
});
|
|
|
|
// create entity
|
|
await api.system.addConfig("data", "entities.posts", {
|
|
config: { sort_field: "id", sort_dir: "asc" },
|
|
fields: { id: { type: "primary" }, asdf: { type: "text" } },
|
|
type: "regular",
|
|
});
|
|
|
|
expect(app.em.entities.map((e) => e.name)).toContain("posts");
|
|
});
|
|
});
|