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/*",
"./components": "./components/index.ts",
"./components/*": "./components/*",
"./integration": "./integrations/index.js",
"./integration": "./dist/integrations/index.js",
"./toolbar": "./dist/toolbar/index.js",
"./assets": "./dist/assets/index.js",
"./assets/utils": "./dist/assets/utils/index.js",

View file

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

View file

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