mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -05:00
f21357b69d
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
34 lines
754 B
JavaScript
34 lines
754 B
JavaScript
// @ts-check
|
|
import { fileURLToPath } from 'url';
|
|
|
|
export * from '../../../../astro/test/test-utils.js';
|
|
|
|
/**
|
|
*
|
|
* @returns {import('../../../../astro/dist/types/@types/astro').AstroIntegration}
|
|
*/
|
|
export function testIntegration({ setEntryPoints } = {}) {
|
|
return {
|
|
name: '@astrojs/netlify/test-integration',
|
|
hooks: {
|
|
'astro:config:setup': ({ updateConfig }) => {
|
|
updateConfig({
|
|
vite: {
|
|
resolve: {
|
|
alias: {
|
|
'@astrojs/netlify/netlify-functions.js': fileURLToPath(
|
|
new URL('../../dist/netlify-functions.js', import.meta.url)
|
|
),
|
|
},
|
|
},
|
|
},
|
|
});
|
|
},
|
|
'astro:build:ssr': ({ entryPoints }) => {
|
|
if (entryPoints.size) {
|
|
setEntryPoints(entryPoints);
|
|
}
|
|
},
|
|
},
|
|
};
|
|
}
|