55 * This source code is licensed under the BSD-style license found in the 
66 * LICENSE file in the root directory of this source tree. An additional grant 
77 * of patent rights can be found in the PATENTS file in the same directory. 
8+  * 
9+  * @flow  
810 */ 
911
12+ import  {  Reporter  }  from  "../../src/reporters/index.js" ; 
1013import  *  as  reporters  from  "../../src/reporters/index.js" ; 
1114import  *  as  constants  from  "../../src/constants.js" ; 
1215import  {  default  as  Lockfile ,  parse  }  from  "../../src/lockfile/index.js" ; 
@@ -18,8 +21,8 @@ import assert from "assert";
1821import  semver  from  "semver" ; 
1922
2023let  stream  =  require ( "stream" ) ; 
21- let  test     =  require ( "ava" ) ; 
22- let  path     =  require ( "path" ) ; 
24+ let  test  =  require ( "ava" ) ; 
25+ let  path  =  require ( "path" ) ; 
2326
2427let  fixturesLoc  =  path . join ( __dirname ,  ".." ,  "fixtures" ,  "install" ) ; 
2528
@@ -41,7 +44,13 @@ async function createLockfile(dir, strict, save) {
4144  return  new  Lockfile ( lockfile ,  strict ,  save ) ; 
4245} 
4346
44- async  function  run ( flags ,  args ,  name ,  checkInstalled ,  beforeInstall )  { 
47+ async  function  run ( 
48+   flags : Object , 
49+   args : Array < string > , 
50+   name : string , 
51+   checkInstalled : ?( config : Config ,  reporter : Reporter )  = >  ?Promise < void > , 
52+   beforeInstall : ?( cwd : string )  = >  ?Promise < void > 
53+ )  { 
4554  let  out =  "" ; 
4655  let  stdout  =  new  stream . Writable ( { 
4756    write ( data )  { 
@@ -117,7 +126,6 @@ test("[network] install with arg that has binaries", () => {
117126test ( "[network] install with --save and offline mirror" ,  ( )  =>  { 
118127  let  mirrorPath  =  "mirror-for-offline" ; 
119128  return  run ( { save : true } ,  [ "is-array@1.0.1" ] ,  "install-with-save-offline-mirror" ,  async  ( config )  =>  { 
120- 
121129    let  allFiles  =  await  fs . walk ( config . cwd ) ; 
122130
123131    assert ( allFiles . findIndex ( ( file )  =>  { 
@@ -131,7 +139,6 @@ test("[network] install with --save and offline mirror", () => {
131139
132140    await  fs . unlink ( path . join ( config . cwd ,  mirrorPath ) ) ; 
133141    await  fs . unlink ( path . join ( config . cwd ,  "package.json" ) ) ; 
134-     return  allFiles ; 
135142  } ) ; 
136143} ) ; 
137144
@@ -152,7 +159,6 @@ test("[network] install with --save and without offline mirror", () => {
152159
153160    await  fs . unlink ( path . join ( config . cwd ,  mirrorPath ) ) ; 
154161    await  fs . unlink ( path . join ( config . cwd ,  "package.json" ) ) ; 
155-     return  allFiles ; 
156162  } ) ; 
157163} ) ; 
158164
@@ -164,8 +170,6 @@ test("install from offline mirror", () => {
164170    assert ( allFiles . findIndex ( ( file )  =>  { 
165171      return  file . relative  ===  "node_modules/fake-fbkpm-dependency/package.json" ; 
166172    } )  !==  - 1 ) ; 
167- 
168-     return  allFiles ; 
169173  } ) ; 
170174} ) ; 
171175
0 commit comments