Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Feb 26, 2024
1 parent 7c1a341 commit bb23a68
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/rollup/plugins/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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}: {
Expand Down
5 changes: 4 additions & 1 deletion test/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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" });
Expand Down

0 comments on commit bb23a68

Please sign in to comment.