summaryrefslogtreecommitdiff
path: root/packages/create-astro/test/create-astro.test.js
diff options
context:
space:
mode:
authorGravatar Drew Powers <1369770+drwpow@users.noreply.github.com> 2021-05-28 10:06:22 -0600
committerGravatar GitHub <noreply@github.com> 2021-05-28 10:06:22 -0600
commita0055bd985a6afe503e2ad2cb4f14b550b480a0a (patch)
treed3495a14d26df04714e9bef73b2b0a1bfc9c1faa /packages/create-astro/test/create-astro.test.js
parent556b9e48e4451d5aedfa0f5863c83560ffd2ee69 (diff)
downloadastro-a0055bd985a6afe503e2ad2cb4f14b550b480a0a.tar.gz
astro-a0055bd985a6afe503e2ad2cb4f14b550b480a0a.tar.zst
astro-a0055bd985a6afe503e2ad2cb4f14b550b480a0a.zip
Create astro fixes (#267)
* Remove create-astro from workspace * Improve contrast ratio * Swap blank template for blog template * Remove counter components from blog template * Use `latest` astro version
Diffstat (limited to 'packages/create-astro/test/create-astro.test.js')
-rw-r--r--packages/create-astro/test/create-astro.test.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/create-astro/test/create-astro.test.js b/packages/create-astro/test/create-astro.test.js
index d7abb7e64..aa9323012 100644
--- a/packages/create-astro/test/create-astro.test.js
+++ b/packages/create-astro/test/create-astro.test.js
@@ -8,24 +8,24 @@ import * as assert from 'uvu/assert';
const CreateAstro = suite('npm init astro');
-const cwd = fileURLToPath(new URL('./fixtures/', import.meta.url));
-
-const templates = ['blank', 'starter'];
+const cwd = fileURLToPath(path.dirname(import.meta.url));
+const templates = fs.readdirSync(path.join(cwd, '..', 'src', 'templates'));
CreateAstro.before(async () => {
- await del(cwd);
- await fs.promises.mkdir(cwd);
+ const fixturesDir = path.join(cwd, 'fixtures');
+ await del(fixturesDir);
+ await fs.promises.mkdir(fixturesDir);
});
for (const template of templates) {
CreateAstro(template, async () => {
- const { stdout } = await execa('../../create-astro.js', [`./${template}`, '--template', template, '--skip-install'], { cwd });
+ const { stdout } = await execa('../../create-astro.js', [`./${template}`, '--template', template, '--skip-install'], { cwd: path.join(cwd, 'fixtures') });
// test: path should formatted as './{dirName}'
assert.not.match(stdout, '././');
const DOES_HAVE = ['.gitignore', 'package.json', 'public', 'src'];
- const DOES_NOT_HAVE = ['_gitignore', 'meta.json', 'node_modules'];
+ const DOES_NOT_HAVE = ['_gitignore', 'meta.json', 'node_modules', 'yarn.lock'];
// test: template contains essential files & folders
for (const file of DOES_HAVE) {