import { fromFileUrl, readableStreamFromReader } from './deps.ts'; const dir = new URL('./', import.meta.url); export function loadFixture(fixturePath: string, envionmentVariables?: Record) { async function runBuild() { const proc = Deno.run({ cmd: ['node', '../../../../../../astro/astro.js', 'build'], env: envionmentVariables, cwd: fromFileUrl(new URL(fixturePath, dir)), }); await proc.status(); proc.close(); } async function runApp(entryPath: string) { const entryUrl = new URL(entryPath, dir); let proc = Deno.run({ cmd: ['deno', 'run', '--allow-env', '--allow-net', fromFileUrl(entryUrl)], env: envionmentVariables, //cwd: fromFileUrl(entryUrl), stderr: 'piped', }); const stderr = readableStreamFromReader(proc.stderr); const dec = new TextDecoder(); for await (let bytes of stderr) { let msg = dec.decode(bytes); if (msg.includes(`Server running`)) { break; } } return () => proc.close(); } async function cleanup() { const netlifyPath = new URL('.netlify', new URL(fixturePath, dir)); const distPath = new URL('dist', new URL(fixturePath, dir)); // remove the netlify folder await Deno.remove(netlifyPath, { recursive: true }); // remove the dist folder await Deno.remove(distPath, { recursive: true }); } return { runApp, runBuild, cleanup, }; } option value='astro-store'>astro-store Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/packages/renderers/renderer-vue/static-html.js (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2021-09-09Version Packages (#1344)Gravatar github-actions[bot] 29-53/+42
2021-09-09Revert "Version Packages (#1303)"Gravatar Fred K. Schott 29-42/+53
2021-09-09update lockfileastro@0.20.5@astrojs/markdown-support@0.3.1Gravatar Fred K. Schott 1-9/+9
2021-09-09Version Packages (#1303)Gravatar github-actions[bot] 29-53/+42
2021-09-09[ci] collect statsGravatar FredKSchott 2-1/+2
2021-09-08Update netlify deploy instructions for `.nvmrc` syntax (#1337)Gravatar Caleb Jasik 1-1/+1
2021-09-08[ci] yarn formatGravatar jasikpark 1-1/+0