@@ -46,7 +46,7 @@ describe('NgPackagesInstaller', () => {
4646 fs . existsSync . and . returnValue ( true ) ;
4747 installer . checkDependencies ( ) ;
4848 expect ( fs . existsSync ) . toHaveBeenCalledWith ( path . resolve ( projectDir , 'node_modules/_local_.json' ) ) ;
49- expect ( installer . _printWarning ) . toHaveBeenCalled ( ) ;
49+ expect ( installer . _printWarning ) . toHaveBeenCalledWith ( ) ;
5050 } ) ;
5151 } ) ;
5252
@@ -163,15 +163,15 @@ describe('NgPackagesInstaller', () => {
163163
164164 it ( 'should not continue processing' , ( ) => {
165165 installer . installLocalDependencies ( ) ;
166- expect ( installer . _checkLocalMarker ) . toHaveBeenCalled ( ) ;
166+ expect ( installer . _checkLocalMarker ) . toHaveBeenCalledWith ( ) ;
167167 expect ( installer . _getDistPackages ) . not . toHaveBeenCalled ( ) ;
168168 } ) ;
169169
170170 it ( 'should continue processing (without checking for local marker) if `force` is true' , ( ) => {
171171 installer . force = true ;
172172 installer . installLocalDependencies ( ) ;
173173 expect ( installer . _checkLocalMarker ) . not . toHaveBeenCalled ( ) ;
174- expect ( installer . _getDistPackages ) . toHaveBeenCalled ( ) ;
174+ expect ( installer . _getDistPackages ) . toHaveBeenCalledWith ( ) ;
175175 } ) ;
176176 } ) ;
177177
@@ -180,16 +180,17 @@ describe('NgPackagesInstaller', () => {
180180
181181 beforeEach ( ( ) => {
182182 log = [ ] ;
183- fs . writeFileSync . and . callFake ( ( filePath , contents ) => filePath === packageJsonPath && log . push ( `writeFile: ${ contents } ` ) ) ;
183+ fs . writeFileSync . and . callFake ( ( filePath , contents ) =>
184+ filePath === packageJsonPath && log . push ( `writeFile: ${ contents } ` ) ) ;
184185 installer . _installDeps . and . callFake ( ( ...args ) => log . push ( `installDeps: ${ args . join ( ' ' ) } ` ) ) ;
185186 installer . _checkLocalMarker . and . returnValue ( false ) ;
186187 installer . installLocalDependencies ( ) ;
187188 } ) ;
188189
189190 it ( 'should parse the lockfile and get the dist packages' , ( ) => {
190- expect ( installer . _checkLocalMarker ) . toHaveBeenCalled ( ) ;
191+ expect ( installer . _checkLocalMarker ) . toHaveBeenCalledWith ( ) ;
191192 expect ( installer . _parseLockfile ) . toHaveBeenCalledWith ( yarnLockPath ) ;
192- expect ( installer . _getDistPackages ) . toHaveBeenCalled ( ) ;
193+ expect ( installer . _getDistPackages ) . toHaveBeenCalledWith ( ) ;
193194 } ) ;
194195
195196 it ( 'should temporarily overwrite the package.json files of local Angular packages' , ( ) => {
@@ -260,7 +261,7 @@ describe('NgPackagesInstaller', () => {
260261 it ( 'should overwrite package.json, then install deps, then restore original package.json' , ( ) => {
261262 expect ( log ) . toEqual ( [
262263 `writeFile: ${ expectedModifiedPackageJson } ` ,
263- ` installDeps: --pure-lockfile --check-files` ,
264+ ' installDeps: --pure-lockfile --check-files' ,
264265 `writeFile: ${ dummyPackageJson } `
265266 ] ) ;
266267 } ) ;
@@ -316,7 +317,8 @@ describe('NgPackagesInstaller', () => {
316317
317318 expect ( shelljs . exec ) . not . toHaveBeenCalled ( ) ;
318319 expect ( warning ) . toContain (
319- 'Automatically building the local Angular/Zone.js packages is currently not supported on Windows.' ) ;
320+ 'Automatically building the local Angular/angular-in-memory-web-api/zone.js packages is currently not ' +
321+ 'supported on Windows.' ) ;
320322 expect ( warning ) . toContain ( 'Git Bash for Windows' ) ;
321323 expect ( warning ) . toContain ( 'Windows Subsystem for Linux' ) ;
322324 expect ( warning ) . toContain ( 'Linux docker container or VM' ) ;
@@ -340,7 +342,8 @@ describe('NgPackagesInstaller', () => {
340342 expect ( installer . _buildDistPackages ) . toHaveBeenCalledTimes ( 1 ) ;
341343 } ) ;
342344
343- it ( 'should not build the local packages by default' , ( ) => {
345+ it ( 'should not build the local packages, if `buildPackages` is false' , ( ) => {
346+ installer = new NgPackagesInstaller ( projectDir , { buildPackages : false } ) ;
344347 installer . _getDistPackages ( ) ;
345348 expect ( installer . _buildDistPackages ) . not . toHaveBeenCalled ( ) ;
346349 } ) ;
@@ -506,7 +509,7 @@ describe('NgPackagesInstaller', () => {
506509 it ( 'should throw if parsing the lockfile fails' , ( ) => {
507510 lockfile . parse . and . returnValue ( { type : 'not success' } ) ;
508511 expect ( ( ) => installer . _parseLockfile ( '/foo/bar/yarn.lock' ) ) . toThrowError (
509- '[NgPackagesInstaller]: Error parsing lockfile \'/foo/bar/yarn.lock\' (result type: not success).' ) ;
512+ '[NgPackagesInstaller]: Error parsing lockfile \'/foo/bar/yarn.lock\' (result type: not success).' ) ;
510513 } ) ;
511514
512515 it ( 'should return the parsed lockfile content as an object' , ( ) => {
0 commit comments