diff options
author | 2021-05-26 06:16:49 +0800 | |
---|---|---|
committer | 2021-05-25 17:16:49 -0500 | |
commit | 760a7a5509fc81a63d47948dbe040dcc8007d0fe (patch) | |
tree | a30287a5daa3b97a3ca7a5a34ecd021994152fea /packages/create-astro/test/create-astro.test.js | |
parent | f5ecbee192ef24f52f78ffad0ba7bce686bd45c7 (diff) | |
download | astro-760a7a5509fc81a63d47948dbe040dcc8007d0fe.tar.gz astro-760a7a5509fc81a63d47948dbe040dcc8007d0fe.tar.zst astro-760a7a5509fc81a63d47948dbe040dcc8007d0fe.zip |
Support skip install deps (#242)
* Support skip install deps
* fmt
* Create new-hats-deliver.md
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Diffstat (limited to 'packages/create-astro/test/create-astro.test.js')
-rw-r--r-- | packages/create-astro/test/create-astro.test.js | 9 |
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}`); } }); } |