Unverified Commit 428a7de5 authored by James George's avatar James George Committed by GitHub

test(create-next-app): suppplying --use-npm prefers npm for installation (#23880)

This PR aims at updating the `create-next-app` test suite to include a test case for the `--use-npm` flag.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [ ] Make sure the linting passes
parent c5c16494
...@@ -275,4 +275,22 @@ describe('create next app', () => { ...@@ -275,4 +275,22 @@ describe('create next app', () => {
) )
}) })
}) })
it('should use npm as the package manager on supplying --use-npm', async () => {
await usingTempDir(async (cwd) => {
const projectName = 'use-npm'
const res = await run([projectName, '--use-npm'], { cwd })
expect(res.exitCode).toBe(0)
const files = [
'package.json',
'pages/index.js',
'.gitignore',
'package-lock.json',
]
files.forEach((file) =>
expect(fs.existsSync(path.join(cwd, projectName, file))).toBeTruthy()
)
})
})
}) })
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