summaryrefslogtreecommitdiff
path: root/packages/create-astro/test/external.test.js
blob: 87c50338ade6f2fb5eb92404aa73fa33d9efb094 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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);
});