1
- import { trace } from 'next/dist/trace'
2
1
import {
3
2
DEFAULT_FILES ,
4
3
FULL_EXAMPLE_PATH ,
5
4
projectFilesShouldExist ,
6
5
run ,
7
6
useTempDir ,
8
7
} from '../utils'
9
- import { createNextInstall } from '../../../lib/create-next-install'
10
8
11
9
const lockFile = 'package-lock.json'
12
10
const files = [ ...DEFAULT_FILES , lockFile ]
13
11
14
- let nextInstall : Awaited < ReturnType < typeof createNextInstall > >
15
- beforeAll ( async ( ) => {
16
- nextInstall = await createNextInstall ( {
17
- parentSpan : trace ( 'test' ) ,
18
- keepRepoDir : Boolean ( process . env . NEXT_TEST_SKIP_CLEANUP ) ,
19
- } )
20
- } )
21
-
22
12
describe ( 'create-next-app with package manager npm' , ( ) => {
23
13
it ( 'should use npm for --use-npm flag' , async ( ) => {
24
14
await useTempDir ( async ( cwd ) => {
@@ -34,7 +24,6 @@ describe('create-next-app with package manager npm', () => {
34
24
'--no-tailwind' ,
35
25
'--no-import-alias' ,
36
26
] ,
37
- nextInstall . installDir ,
38
27
{
39
28
cwd,
40
29
}
@@ -63,7 +52,6 @@ it('should use npm when user-agent is npm', async () => {
63
52
'--no-tailwind' ,
64
53
'--no-import-alias' ,
65
54
] ,
66
- nextInstall . installDir ,
67
55
{
68
56
cwd,
69
57
env : { npm_config_user_agent : 'npm' } ,
@@ -84,7 +72,6 @@ it('should use npm for --use-npm flag with example', async () => {
84
72
const projectName = 'use-npm-with-example'
85
73
const res = await run (
86
74
[ projectName , '--use-npm' , '--example' , FULL_EXAMPLE_PATH ] ,
87
- nextInstall . installDir ,
88
75
{ cwd }
89
76
)
90
77
@@ -100,14 +87,10 @@ it('should use npm for --use-npm flag with example', async () => {
100
87
it ( 'should use npm when user-agent is npm with example' , async ( ) => {
101
88
await useTempDir ( async ( cwd ) => {
102
89
const projectName = 'user-agent-npm-with-example'
103
- const res = await run (
104
- [ projectName , '--example' , FULL_EXAMPLE_PATH ] ,
105
- nextInstall . installDir ,
106
- {
107
- cwd,
108
- env : { npm_config_user_agent : 'npm' } ,
109
- }
110
- )
90
+ const res = await run ( [ projectName , '--example' , FULL_EXAMPLE_PATH ] , {
91
+ cwd,
92
+ env : { npm_config_user_agent : 'npm' } ,
93
+ } )
111
94
112
95
expect ( res . exitCode ) . toBe ( 0 )
113
96
projectFilesShouldExist ( {
0 commit comments