@@ -45,14 +45,6 @@ describe("Unit - Package Manager", () => {
4545 }
4646 return "" ;
4747 } ) ;
48- spyOn ( Util , "spawnSync" ) . and . returnValues ( {
49- status : 0 ,
50- pid : 0 ,
51- output : [ ] ,
52- stdout : "" ,
53- stderr : "" ,
54- signal : "SIGABRT"
55- } ) ;
5648 spyOn ( Util , "log" ) ;
5749 spyOn ( PackageManager , "removePackage" ) ;
5850 await PackageManager . ensureIgniteUISource ( true , mockTemplateMgr , true ) ;
@@ -75,9 +67,8 @@ describe("Unit - Package Manager", () => {
7567 "yellow"
7668 ) ;
7769 expect ( path . join ) . toHaveBeenCalled ( ) ;
78- expect ( Util . spawnSync ) . toHaveBeenCalledWith (
79- / ^ w i n / . test ( process . platform ) ? "npm.cmd" : "npm" ,
80- [ "adduser" , `--registry=trial` , `--scope=@infragistics` , `--auth-type=legacy` ] ,
70+ expect ( Util . execSync ) . toHaveBeenCalledWith (
71+ "npm login --registry=trial --scope=@infragistics --auth-type=legacy" ,
8172 {
8273 stdio : "inherit"
8374 }
@@ -119,14 +110,6 @@ describe("Unit - Package Manager", () => {
119110 spyOn ( Util , "log" ) ;
120111 spyOn ( TestPackageManager , "removePackage" ) ;
121112 spyOn ( TestPackageManager , "getPackageJSON" ) . and . callFake ( ( ) => mockRequire ) ;
122- spyOn ( Util , "spawnSync" ) . and . returnValues ( {
123- status : 1 ,
124- pid : 0 ,
125- output : [ ] ,
126- stdout : "" ,
127- stderr : "" ,
128- signal : "SIGABRT"
129- } ) ;
130113 await TestPackageManager . ensureIgniteUISource ( true , mockTemplateMgr , true ) ;
131114 expect ( ProjectConfig . localConfig ) . toHaveBeenCalled ( ) ;
132115 expect ( Util . log ) . toHaveBeenCalledTimes ( 12 ) ;
@@ -162,14 +145,13 @@ describe("Unit - Package Manager", () => {
162145 `for instructions on how to install the full package.` ,
163146 "yellow"
164147 ) ; // x1
165- expect ( Util . spawnSync ) . toHaveBeenCalledWith (
166- / ^ w i n / . test ( process . platform ) ? "npm.cmd" : "npm" ,
167- [ "adduser" , `--registry=trial` , `--scope=@infragistics` , `--auth-type=legacy` ] ,
148+ expect ( Util . execSync ) . toHaveBeenCalledWith (
149+ "npm login --registry=trial --scope=@infragistics --auth-type=legacy" ,
168150 {
169151 stdio : "inherit"
170152 }
171153 ) ;
172- expect ( Util . execSync ) . toHaveBeenCalledTimes ( 2 ) ;
154+ expect ( Util . execSync ) . toHaveBeenCalledTimes ( 4 /* ¯\(°_o)/¯*/ ) ;
173155 expect ( Util . execSync ) . toHaveBeenCalledWith ( `npm whoami --registry=trial` , { stdio : "pipe" , encoding : "utf8" } ) ;
174156 } ) ;
175157 it ( "ensureIgniteUISource - Should run through properly when install now is set to false" , async ( ) => {
0 commit comments