d10c3dea21
* Replaced `--experimental-ssr` with `isBuildingToSSR` * changest * Improved `isBuildingToSSR` a bit * Added `isBuildingToSSR` to more places!!1! * Added `@deprecated` tag * Replaced missing experimentalSsr * Added failing test * Removed test * Re-added experimental ssr flag * Fixed typo Co-authored-by: Matthew Phillips <matthew@skypack.dev> * Fixed deno tests Co-authored-by: Matthew Phillips <matthew@skypack.dev>
20 lines
606 B
JavaScript
20 lines
606 B
JavaScript
import { fromFileUrl } from './deps.js';
|
|
const dir = new URL('./', import.meta.url);
|
|
|
|
export async function runBuild(fixturePath) {
|
|
let proc = Deno.run({
|
|
cmd: ['node', '../../../../../astro/astro.js', 'build', '--silent'],
|
|
cwd: fromFileUrl(new URL(fixturePath, dir)),
|
|
});
|
|
await proc.status();
|
|
return async () => await proc.close();
|
|
}
|
|
|
|
export async function runBuildAndStartApp(fixturePath, cb) {
|
|
const url = new URL(fixturePath, dir);
|
|
const close = await runBuild(fixturePath);
|
|
const mod = await import(new URL('./dist/server/entry.mjs', url));
|
|
await cb();
|
|
await mod.stop();
|
|
await close();
|
|
}
|