Unverified Commit 1bb05961 authored by Max Proske's avatar Max Proske Committed by GitHub

Fix "infer pnpm with example" test outside test suite (#43487)

Fixes pnpm w/ example being the only test outside the test suite.

Before:
```ts
describe('create next app', () => {
  // ...
})

it('should infer pnpm as the package manager with example', () => { ... })
```

After:
```ts
describe('create next app', () => {
  // ...

  it('should infer pnpm as the package manager with example', () => { ... })
})
```


## Documentation / Examples

- [X] Make sure the linting passes by running `pnpm build && pnpm lint`
parent f6106d20
...@@ -606,38 +606,38 @@ describe('create next app', () => { ...@@ -606,38 +606,38 @@ describe('create next app', () => {
projectFilesShouldExist({ cwd, projectName, files }) projectFilesShouldExist({ cwd, projectName, files })
}) })
}) })
})
it('should infer pnpm as the package manager with example', async () => { it('should infer pnpm as the package manager with example', async () => {
try { try {
await execa('pnpm', ['--version']) await execa('pnpm', ['--version'])
} catch (_) { } catch (_) {
// install pnpm if not available // install pnpm if not available
await execa('npm', ['i', '-g', 'pnpm']) await execa('npm', ['i', '-g', 'pnpm'])
} }
await useTempDir(async (cwd) => { await useTempDir(async (cwd) => {
const projectName = 'infer-package-manager-npm' const projectName = 'infer-package-manager-npm'
const res = await run( const res = await run(
[ [
projectName, projectName,
'--js', '--js',
'--eslint', '--eslint',
'--example', '--example',
`${exampleRepo}/${examplePath}`, `${exampleRepo}/${examplePath}`,
], ],
{ cwd, env: { ...process.env, npm_config_user_agent: 'pnpm' } } { cwd, env: { ...process.env, npm_config_user_agent: 'pnpm' } }
) )
const files = [ const files = [
'package.json', 'package.json',
'pages/index.tsx', 'pages/index.tsx',
'.gitignore', '.gitignore',
'pnpm-lock.yaml', 'pnpm-lock.yaml',
'node_modules/next', 'node_modules/next',
] ]
expect(res.exitCode).toBe(0) expect(res.exitCode).toBe(0)
projectFilesShouldExist({ cwd, projectName, files }) projectFilesShouldExist({ cwd, projectName, files })
})
}) })
}) })
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment