mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
48 lines
1.4 KiB
TypeScript
48 lines
1.4 KiB
TypeScript
import { AppServer, serverConfigSchema } from "modules/server/AppServer";
|
|
import { describe, test, expect } from "bun:test";
|
|
|
|
describe("AppServer", () => {
|
|
test("config", () => {
|
|
{
|
|
const server = new AppServer();
|
|
expect(server).toBeDefined();
|
|
expect(server.config).toEqual({
|
|
cors: {
|
|
allow_credentials: true,
|
|
origin: "*",
|
|
allow_methods: ["GET", "POST", "PATCH", "PUT", "DELETE"],
|
|
allow_headers: ["Content-Type", "Content-Length", "Authorization", "Accept"],
|
|
},
|
|
mcp: {
|
|
enabled: false,
|
|
path: "/api/system/mcp",
|
|
logLevel: "warning",
|
|
},
|
|
});
|
|
}
|
|
|
|
{
|
|
const server = new AppServer({
|
|
cors: {
|
|
origin: "https",
|
|
allow_methods: ["GET", "POST"],
|
|
},
|
|
});
|
|
expect(server).toBeDefined();
|
|
expect(server.config).toEqual({
|
|
cors: {
|
|
allow_credentials: true,
|
|
origin: "https",
|
|
allow_methods: ["GET", "POST"],
|
|
allow_headers: ["Content-Type", "Content-Length", "Authorization", "Accept"],
|
|
},
|
|
mcp: {
|
|
enabled: false,
|
|
path: "/api/system/mcp",
|
|
logLevel: "warning",
|
|
},
|
|
});
|
|
}
|
|
});
|
|
});
|