From 742f5d9a46ed5244409ea0389d019fce375f28e3 Mon Sep 17 00:00:00 2001 From: James George Date: Mon, 5 Oct 2020 18:34:25 +0530 Subject: [PATCH] test(create-next-app): increase coverage (#17507) Added a test case to make sure that creating a new project within the current directory works as expected. --- test/integration/create-next-app/index.test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/integration/create-next-app/index.test.js b/test/integration/create-next-app/index.test.js index 63cb6de6a20a5bb..da7c0c858bd512f 100644 --- a/test/integration/create-next-app/index.test.js +++ b/test/integration/create-next-app/index.test.js @@ -275,4 +275,16 @@ describe('create next app', () => { } }, 0o500) }) + + it('should create a project in the current directory', async () => { + await usingTempDir(async (cwd) => { + const res = await run(cwd, '.') + expect(res.exitCode).toBe(0) + + const files = ['package.json', 'pages/index.js', '.gitignore'] + files.forEach((file) => + expect(fs.existsSync(path.join(cwd, file))).toBeTruthy() + ) + }) + }) })