mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
7c49194ca2
* wip: add prompt for directory with validation
* feat: wire up dir response to cwd
* feat: improve error handling on non-empty dirs
* fix: update test helpers to execaSync
* chore: add .skipped to old tests for clarity
* deps: add mocha and chai to create-astro
* feat: add directory step test with fixture
* feat: update turbo to run create-astro tests again 🥳
* chore: changeset
27 lines
668 B
Text
27 lines
668 B
Text
import assert from 'assert';
|
|
import { execa } from 'execa';
|
|
import { FIXTURES_URL } from './helpers.js';
|
|
import { existsSync } from 'fs';
|
|
|
|
async function run(outdir, template) {
|
|
//--template cassidoo/shopify-react-astro
|
|
await execa('../../create-astro.mjs', [outdir, '--template', template, '--force-overwrite'], {
|
|
cwd: FIXTURES_URL.pathname,
|
|
});
|
|
}
|
|
|
|
const testCases = [['shopify', 'cassidoo/shopify-react-astro']];
|
|
|
|
async function tests() {
|
|
for (let [dir, tmpl] of testCases) {
|
|
await run(dir, tmpl);
|
|
|
|
const outPath = new URL('' + dir, FIXTURES_URL);
|
|
assert.ok(existsSync(outPath));
|
|
}
|
|
}
|
|
|
|
tests().catch((err) => {
|
|
console.error(err);
|
|
process.exit(1);
|
|
});
|