2022-04-19 15:22:15 +00:00
|
|
|
// @ts-check
|
2023-07-18 00:17:59 +00:00
|
|
|
import { fileURLToPath } from 'node:url';
|
2022-04-19 15:22:15 +00:00
|
|
|
|
|
|
|
export * from '../../../../astro/test/test-utils.js';
|
|
|
|
|
|
|
|
/**
|
2022-04-19 15:23:07 +00:00
|
|
|
*
|
2022-04-19 15:22:15 +00:00
|
|
|
* @returns {import('../../../../astro/dist/types/@types/astro').AstroIntegration}
|
|
|
|
*/
|
2023-07-13 08:21:33 +00:00
|
|
|
export function testIntegration({ setEntryPoints } = {}) {
|
2022-04-19 15:22:15 +00:00
|
|
|
return {
|
|
|
|
name: '@astrojs/netlify/test-integration',
|
|
|
|
hooks: {
|
2022-04-19 15:23:07 +00:00
|
|
|
'astro:config:setup': ({ updateConfig }) => {
|
2022-04-19 15:22:15 +00:00
|
|
|
updateConfig({
|
|
|
|
vite: {
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
'@astrojs/netlify/netlify-functions.js': fileURLToPath(
|
|
|
|
new URL('../../dist/netlify-functions.js', import.meta.url)
|
|
|
|
),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
2022-04-19 15:23:07 +00:00
|
|
|
},
|
2023-07-13 08:21:33 +00:00
|
|
|
'astro:build:ssr': ({ entryPoints }) => {
|
|
|
|
if (entryPoints.size) {
|
|
|
|
setEntryPoints(entryPoints);
|
|
|
|
}
|
|
|
|
},
|
2022-04-19 15:23:07 +00:00
|
|
|
},
|
2022-04-19 15:22:15 +00:00
|
|
|
};
|
|
|
|
}
|