fix tests: replace initialConfig with config

This commit is contained in:
dswbx
2025-09-04 10:44:14 +02:00
parent e3888537f9
commit 758a89b5d7
31 changed files with 78 additions and 96 deletions

View File

@@ -1,9 +1,19 @@
import { describe, expect, mock, test } from "bun:test";
import type { ModuleBuildContext } from "../../src";
import { App, createApp } from "core/test/utils";
import * as proto from "../../src/data/prototype";
import * as proto from "data/prototype";
import { DbModuleManager } from "modules/manager/DbModuleManager";
describe("App", () => {
test("use db mode by default", async () => {
const app = createApp();
await app.build();
expect(app.mode).toBe("db");
expect(app.isReadOnly()).toBe(false);
expect(app.modules instanceof DbModuleManager).toBe(true);
});
test("seed includes ctx and app", async () => {
const called = mock(() => null);
await createApp({
@@ -29,7 +39,7 @@ describe("App", () => {
expect(called).toHaveBeenCalled();
const app = createApp({
initialConfig: {
config: {
data: proto
.em({
todos: proto.entity("todos", {
@@ -139,7 +149,7 @@ describe("App", () => {
test("getMcpClient", async () => {
const app = createApp({
initialConfig: {
config: {
server: {
mcp: {
enabled: true,

View File

@@ -29,7 +29,7 @@ describe("mcp auth", async () => {
let server: McpServer;
beforeEach(async () => {
app = createApp({
initialConfig: {
config: {
auth: {
enabled: true,
jwt: {

View File

@@ -8,7 +8,7 @@ describe("mcp", () => {
registries.media.register("local", StorageLocalAdapter);
const app = createApp({
initialConfig: {
config: {
auth: {
enabled: true,
},

View File

@@ -41,7 +41,7 @@ describe("mcp data", async () => {
beforeEach(async () => {
const time = performance.now();
app = createApp({
initialConfig: {
config: {
server: {
mcp: {
enabled: true,

View File

@@ -21,7 +21,7 @@ describe("mcp media", async () => {
beforeEach(async () => {
registries.media.register("local", StorageLocalAdapter);
app = createApp({
initialConfig: {
config: {
media: {
enabled: true,
adapter: {

View File

@@ -11,7 +11,7 @@ describe("mcp system", async () => {
let server: McpServer;
beforeAll(async () => {
app = createApp({
initialConfig: {
config: {
server: {
mcp: {
enabled: true,

View File

@@ -14,7 +14,7 @@ describe("mcp system", async () => {
let server: McpServer;
beforeAll(async () => {
app = createApp({
initialConfig: {
config: {
server: {
mcp: {
enabled: true,

View File

@@ -88,7 +88,7 @@ describe("repros", async () => {
fns.relation(schema.product_likes).manyToOne(schema.users);
},
);
const app = createApp({ initialConfig: { data: schema.toJSON() } });
const app = createApp({ config: { data: schema.toJSON() } });
await app.build();
const info = (await (await app.server.request("/api/data/info/products")).json()) as any;