2021-07-06 19:14:22 +00:00
|
|
|
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,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-07-07 20:10:09 +00:00
|
|
|
const testCases = [['shopify', 'cassidoo/shopify-react-astro']];
|
2021-07-06 19:14:22 +00:00
|
|
|
|
|
|
|
async function tests() {
|
2021-07-07 20:10:09 +00:00
|
|
|
for (let [dir, tmpl] of testCases) {
|
2021-07-06 19:14:22 +00:00
|
|
|
await run(dir, tmpl);
|
|
|
|
|
|
|
|
const outPath = new URL('' + dir, FIXTURES_URL);
|
|
|
|
assert.ok(existsSync(outPath));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-07 20:10:09 +00:00
|
|
|
tests().catch((err) => {
|
2021-07-06 19:14:22 +00:00
|
|
|
console.error(err);
|
|
|
|
process.exit(1);
|
2021-07-07 20:10:09 +00:00
|
|
|
});
|