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:
parent
c4d4378c50
commit
b60b5fded0
3 changed files with 21 additions and 15 deletions
|
@ -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",
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
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({
|
||||||
return {
|
name: "db-test-integration",
|
||||||
name: 'db-test-integration',
|
setup() {
|
||||||
hooks: {
|
return {
|
||||||
|
hooks: {
|
||||||
'astro:db:setup': ({ extendDb }) => {
|
'astro:db:setup': ({ extendDb }) => {
|
||||||
extendDb({
|
extendDb({
|
||||||
configEntrypoint: './integration/config.ts',
|
configEntrypoint: './integration/config.ts',
|
||||||
|
@ -16,5 +18,6 @@ export default function testIntegration(): AstroIntegration {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
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({
|
||||||
return {
|
name: "db-test-integration",
|
||||||
name: 'db-test-integration',
|
setup() {
|
||||||
hooks: {
|
return {
|
||||||
|
hooks: {
|
||||||
'astro:db:setup': ({ extendDb }) => {
|
'astro:db:setup': ({ extendDb }) => {
|
||||||
extendDb({
|
extendDb({
|
||||||
configEntrypoint: './integration/config.ts',
|
configEntrypoint: './integration/config.ts',
|
||||||
|
@ -16,5 +18,6 @@ export default function testIntegration(): AstroIntegration {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
|
Loading…
Reference in a new issue