0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

fix: astro db tests

This commit is contained in:
Florian Lefebvre 2024-04-29 19:36:12 +02:00
parent c4d4378c50
commit b60b5fded0
3 changed files with 21 additions and 15 deletions

View file

@ -53,7 +53,7 @@
"./client/*": "./dist/runtime/client/*", "./client/*": "./dist/runtime/client/*",
"./components": "./components/index.ts", "./components": "./components/index.ts",
"./components/*": "./components/*", "./components/*": "./components/*",
"./integration": "./integrations/index.js", "./integration": "./dist/integrations/index.js",
"./toolbar": "./dist/toolbar/index.js", "./toolbar": "./dist/toolbar/index.js",
"./assets": "./dist/assets/index.js", "./assets": "./dist/assets/index.js",
"./assets/utils": "./dist/assets/utils/index.js", "./assets/utils": "./dist/assets/utils/index.js",

View file

@ -1,13 +1,15 @@
import type { AstroIntegration } from "astro" import {} from "astro"
import { defineIntegration } from "astro/integration"
import type { AstroDbHooks } from "@astrojs/db/types" import type { AstroDbHooks } from "@astrojs/db/types"
declare module "astro" { declare module "astro" {
interface AstroIntegrationHooks extends AstroDbHooks {} interface AstroIntegrationHooks extends AstroDbHooks {}
} }
export default function testIntegration(): AstroIntegration { export default defineIntegration({
name: "db-test-integration",
setup() {
return { return {
name: 'db-test-integration',
hooks: { hooks: {
'astro:db:setup': ({ extendDb }) => { 'astro:db:setup': ({ extendDb }) => {
extendDb({ extendDb({
@ -16,5 +18,6 @@ export default function testIntegration(): AstroIntegration {
}); });
}, },
}, },
}; }
} }
})

View file

@ -1,13 +1,15 @@
import type { AstroIntegration } from "astro" import {} from "astro"
import { defineIntegration } from "astro/integration"
import type { AstroDbHooks } from "@astrojs/db/types" import type { AstroDbHooks } from "@astrojs/db/types"
declare module "astro" { declare module "astro" {
interface AstroIntegrationHooks extends AstroDbHooks {} interface AstroIntegrationHooks extends AstroDbHooks {}
} }
export default function testIntegration(): AstroIntegration { export default defineIntegration({
name: "db-test-integration",
setup() {
return { return {
name: 'db-test-integration',
hooks: { hooks: {
'astro:db:setup': ({ extendDb }) => { 'astro:db:setup': ({ extendDb }) => {
extendDb({ extendDb({
@ -16,5 +18,6 @@ export default function testIntegration(): AstroIntegration {
}); });
}, },
}, },
}; }
} }
})