@@ -165,7 +165,11 @@ const itWithMockNpmRegistry = it.extend<{ registry: { address: string; cwd: stri
165165} )
166166
167167type Test = { packageName : string }
168- type InstallTest = Test & { install : [ cmd : string , args : string [ ] ] ; lockfile : string }
168+ type InstallTest = Test & {
169+ install : [ cmd : string , args : string [ ] ]
170+ lockfile : string
171+ cleanInstall : [ cmd : string , args : string [ ] ]
172+ }
169173type RunTest = Test & { run : [ cmd : string , args : string [ ] ] }
170174
171175const installTests : [ packageManager : string , config : InstallTest ] [ ] = [
@@ -174,6 +178,7 @@ const installTests: [packageManager: string, config: InstallTest][] = [
174178 {
175179 packageName : 'netlify-cli' ,
176180 install : [ 'npm' , [ 'install' , 'netlify-cli@testing' ] ] ,
181+ cleanInstall : [ 'npm' , [ 'ci' ] ] ,
177182 lockfile : 'package-lock.json' ,
178183 } ,
179184 ] ,
@@ -182,6 +187,7 @@ const installTests: [packageManager: string, config: InstallTest][] = [
182187 {
183188 packageName : 'netlify-cli' ,
184189 install : [ 'pnpm' , [ 'add' , 'netlify-cli@testing' ] ] ,
190+ cleanInstall : [ 'pnpm' , [ 'install' , '--frozen-lockfile' ] ] ,
185191 lockfile : 'pnpm-lock.yaml' ,
186192 } ,
187193 ] ,
@@ -190,6 +196,7 @@ const installTests: [packageManager: string, config: InstallTest][] = [
190196 {
191197 packageName : 'netlify-cli' ,
192198 install : [ 'yarn' , [ 'add' , 'netlify-cli@testing' ] ] ,
199+ cleanInstall : [ 'yarn' , [ 'install' , '--frozen-lockfile' ] ] ,
193200 lockfile : 'yarn.lock' ,
194201 } ,
195202 ] ,
@@ -214,6 +221,13 @@ describe.each(installTests)('%s → installs the cli and runs commands without e
214221 `Generated lock file ${ config . lockfile } does not exist in ${ cwd } ` ,
215222 ) . toBe ( true )
216223
224+ // Regression test: ensure we don't trigger known `npm ci` bugs: https://github.com/npm/cli/issues/7622.
225+ await execa ( ...config . cleanInstall , {
226+ cwd,
227+ env : { npm_config_registry : registry . address } ,
228+ stdio : debug . enabled ? 'inherit' : 'ignore' ,
229+ } )
230+
217231 const binary = path . resolve ( path . join ( cwd , `./node_modules/.bin/netlify${ platform ( ) === 'win32' ? '.cmd' : '' } ` ) )
218232
219233 // Help
0 commit comments