From ee3bfd6a7e341d6f397a2568700e12267bb0cb83 Mon Sep 17 00:00:00 2001 From: Max Proske Date: Mon, 28 Nov 2022 17:14:21 -0800 Subject: [PATCH] Fix `it` "Fix infer pnpm with example" outside `describe` "create next app" --- .../integration/create-next-app/index.test.ts | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/test/integration/create-next-app/index.test.ts b/test/integration/create-next-app/index.test.ts index 5b97b7821789..9fa555dc0f9c 100644 --- a/test/integration/create-next-app/index.test.ts +++ b/test/integration/create-next-app/index.test.ts @@ -606,38 +606,38 @@ describe('create next app', () => { projectFilesShouldExist({ cwd, projectName, files }) }) }) -}) -it('should infer pnpm as the package manager with example', async () => { - try { - await execa('pnpm', ['--version']) - } catch (_) { - // install pnpm if not available - await execa('npm', ['i', '-g', 'pnpm']) - } + it('should infer pnpm as the package manager with example', async () => { + try { + await execa('pnpm', ['--version']) + } catch (_) { + // install pnpm if not available + await execa('npm', ['i', '-g', 'pnpm']) + } - await useTempDir(async (cwd) => { - const projectName = 'infer-package-manager-npm' - const res = await run( - [ - projectName, - '--js', - '--eslint', - '--example', - `${exampleRepo}/${examplePath}`, - ], - { cwd, env: { ...process.env, npm_config_user_agent: 'pnpm' } } - ) - - const files = [ - 'package.json', - 'pages/index.tsx', - '.gitignore', - 'pnpm-lock.yaml', - 'node_modules/next', - ] - - expect(res.exitCode).toBe(0) - projectFilesShouldExist({ cwd, projectName, files }) + await useTempDir(async (cwd) => { + const projectName = 'infer-package-manager-npm' + const res = await run( + [ + projectName, + '--js', + '--eslint', + '--example', + `${exampleRepo}/${examplePath}`, + ], + { cwd, env: { ...process.env, npm_config_user_agent: 'pnpm' } } + ) + + const files = [ + 'package.json', + 'pages/index.tsx', + '.gitignore', + 'pnpm-lock.yaml', + 'node_modules/next', + ] + + expect(res.exitCode).toBe(0) + projectFilesShouldExist({ cwd, projectName, files }) + }) }) })