summaryrefslogtreecommitdiff
path: root/packages/create-astro/test
diff options
context:
space:
mode:
Diffstat (limited to 'packages/create-astro/test')
-rw-r--r--packages/create-astro/test/create-astro.test.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/create-astro/test/create-astro.test.js b/packages/create-astro/test/create-astro.test.js
index 5fb556ef3..d7abb7e64 100644
--- a/packages/create-astro/test/create-astro.test.js
+++ b/packages/create-astro/test/create-astro.test.js
@@ -19,10 +19,13 @@ CreateAstro.before(async () => {
for (const template of templates) {
CreateAstro(template, async () => {
- await execa('../../create-astro.js', [template, '--template', template], { cwd });
+ const { stdout } = await execa('../../create-astro.js', [`./${template}`, '--template', template, '--skip-install'], { cwd });
+
+ // 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'];
+ const DOES_NOT_HAVE = ['_gitignore', 'meta.json', 'node_modules'];
// test: template contains essential files & folders
for (const file of DOES_HAVE) {
@@ -31,7 +34,7 @@ for (const template of templates) {
// test: template DOES NOT contain files supposed to be stripped away
for (const file of DOES_NOT_HAVE) {
- assert.not.ok(fs.existsSync(path.join(cwd, template, `does not have ${file}`)));
+ assert.not.ok(fs.existsSync(path.join(cwd, template, file)), `does not have ${file}`);
}
});
}