From bb23a6845a9b81c497cb54b1db30df05808c1f1c Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Mon, 26 Feb 2024 21:53:32 +0100 Subject: [PATCH] update test --- src/rollup/plugins/database.ts | 6 ++++-- test/tests.ts | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/rollup/plugins/database.ts b/src/rollup/plugins/database.ts index 381caa9dc8..c64e3be84d 100644 --- a/src/rollup/plugins/database.ts +++ b/src/rollup/plugins/database.ts @@ -7,7 +7,9 @@ export function database(nitro: Nitro) { (nitro.options.dev && nitro.options.devDatabase) || nitro.options.database; const connectorsNames = [ - ...new Set(Object.values(dbConfigs).map((config) => config?.connector)), + ...new Set( + Object.values(dbConfigs || {}).map((config) => config?.connector) + ), ].filter(Boolean); for (const name of connectorsNames) { @@ -23,7 +25,7 @@ export function database(nitro: Nitro) { ${connectorsNames.map((name) => `import ${name}Connector from "${connectors[name]}";`).join("\n")} export const connectionConfigs = { - ${Object.entries(dbConfigs) + ${Object.entries(dbConfigs || {}) .map( ([name, { connector, options }]) => `${name}: { diff --git a/test/tests.ts b/test/tests.ts index a14554ea97..11dcd39459 100644 --- a/test/tests.ts +++ b/test/tests.ts @@ -660,7 +660,10 @@ export function testNitro( }); describe.skipIf( - !ctx.nitro.options.node || ["deno", "bun"].includes(ctx.preset) + !ctx.nitro.options.node || + ctx.isLambda || + ctx.isWorker || + ["bun", "deno-server", "deno-deploy"].includes(ctx.preset) )("Database", () => { it("works", async () => { const { data } = await callHandler({ url: "/api/db" });