@@ -16,7 +16,7 @@ const spawnMock = jest.fn();
1616
1717jest . mock ( "cross-spawn" , ( ) => ( { sync : spawnMock } ) ) ;
1818
19- describe ( "doInstall " , ( ) => {
19+ describe ( "installPackage " , ( ) => {
2020 let cli ;
2121 let getDefaultPackageManagerSpy ;
2222
@@ -36,7 +36,7 @@ describe("doInstall", () => {
3636 readlineQuestionMock . mockImplementation ( ( _questionTest , cb ) => cb ( "y" ) ) ;
3737 getDefaultPackageManagerSpy . mockResolvedValue ( "npm" ) ;
3838
39- const installResult = await cli . doInstall ( "test-package" ) ;
39+ const installResult = await cli . installPackage ( "test-package" ) ;
4040
4141 expect ( installResult ) . toBe ( "test-package" ) ;
4242 expect ( readlineQuestionMock ) . toHaveBeenCalledTimes ( 1 ) ;
@@ -54,7 +54,7 @@ describe("doInstall", () => {
5454 readlineQuestionMock . mockImplementation ( ( _questionTest , cb ) => cb ( "y" ) ) ;
5555 getDefaultPackageManagerSpy . mockReturnValue ( "yarn" ) ;
5656
57- const installResult = await cli . doInstall ( "test-package" ) ;
57+ const installResult = await cli . installPackage ( "test-package" ) ;
5858
5959 expect ( installResult ) . toBe ( "test-package" ) ;
6060 expect ( readlineQuestionMock ) . toHaveBeenCalledTimes ( 1 ) ;
@@ -72,7 +72,7 @@ describe("doInstall", () => {
7272 readlineQuestionMock . mockImplementation ( ( _questionTest , cb ) => cb ( "y" ) ) ;
7373 getDefaultPackageManagerSpy . mockReturnValue ( "pnpm" ) ;
7474
75- const installResult = await cli . doInstall ( "test-package" ) ;
75+ const installResult = await cli . installPackage ( "test-package" ) ;
7676
7777 expect ( installResult ) . toBe ( "test-package" ) ;
7878 expect ( readlineQuestionMock ) . toHaveBeenCalledTimes ( 1 ) ;
@@ -91,7 +91,7 @@ describe("doInstall", () => {
9191 getDefaultPackageManagerSpy . mockReturnValue ( "npm" ) ;
9292
9393 const preMessage = jest . fn ( ) ;
94- const installResult = await cli . doInstall ( "test-package" , { preMessage } ) ;
94+ const installResult = await cli . installPackage ( "test-package" , { preMessage } ) ;
9595
9696 expect ( installResult ) . toBe ( "test-package" ) ;
9797 expect ( preMessage ) . toHaveBeenCalledTimes ( 1 ) ;
@@ -110,7 +110,7 @@ describe("doInstall", () => {
110110 readlineQuestionMock . mockImplementation ( ( _questionTest , cb ) => cb ( "y" ) ) ;
111111 getDefaultPackageManagerSpy . mockReturnValue ( "npm" ) ;
112112
113- const installResult = await cli . doInstall ( "test-package" ) ;
113+ const installResult = await cli . installPackage ( "test-package" ) ;
114114
115115 expect ( installResult ) . toBe ( "test-package" ) ;
116116 expect ( readlineQuestionMock ) . toHaveBeenCalledTimes ( 1 ) ;
@@ -128,7 +128,7 @@ describe("doInstall", () => {
128128 readlineQuestionMock . mockImplementation ( ( _questionTest , cb ) => cb ( "yes" ) ) ;
129129 getDefaultPackageManagerSpy . mockReturnValue ( "npm" ) ;
130130
131- const installResult = await cli . doInstall ( "test-package" ) ;
131+ const installResult = await cli . installPackage ( "test-package" ) ;
132132
133133 expect ( installResult ) . toBe ( "test-package" ) ;
134134 expect ( readlineQuestionMock ) . toHaveBeenCalledTimes ( 1 ) ;
@@ -146,7 +146,7 @@ describe("doInstall", () => {
146146 readlineQuestionMock . mockImplementation ( ( _questionTest , cb ) => cb ( "yEs" ) ) ;
147147 getDefaultPackageManagerSpy . mockReturnValue ( "npm" ) ;
148148
149- const installResult = await cli . doInstall ( "test-package" ) ;
149+ const installResult = await cli . installPackage ( "test-package" ) ;
150150
151151 expect ( installResult ) . toBe ( "test-package" ) ;
152152 expect ( readlineQuestionMock ) . toHaveBeenCalledTimes ( 1 ) ;
@@ -164,7 +164,7 @@ describe("doInstall", () => {
164164 readlineQuestionMock . mockImplementation ( ( _questionTest , cb ) => cb ( "n" ) ) ;
165165
166166 const mockExit = jest . spyOn ( process , "exit" ) . mockImplementation ( ( ) => { } ) ;
167- const installResult = await cli . doInstall ( "test-package" ) ;
167+ const installResult = await cli . installPackage ( "test-package" ) ;
168168
169169 expect ( installResult ) . toBeUndefined ( ) ;
170170 expect ( readlineQuestionMock ) . toHaveBeenCalledTimes ( 1 ) ;
@@ -179,7 +179,7 @@ describe("doInstall", () => {
179179 readlineQuestionMock . mockImplementation ( ( _questionTest , cb ) => cb ( "n" ) ) ;
180180
181181 const mockExit = jest . spyOn ( process , "exit" ) . mockImplementation ( ( ) => { } ) ;
182- const installResult = await cli . doInstall ( "test-package" ) ;
182+ const installResult = await cli . installPackage ( "test-package" ) ;
183183
184184 expect ( installResult ) . toBeUndefined ( ) ;
185185 expect ( readlineQuestionMock ) . toHaveBeenCalledTimes ( 1 ) ;
@@ -194,7 +194,7 @@ describe("doInstall", () => {
194194 readlineQuestionMock . mockImplementation ( ( _questionTest , cb ) => cb ( "no" ) ) ;
195195
196196 const mockExit = jest . spyOn ( process , "exit" ) . mockImplementation ( ( ) => { } ) ;
197- const installResult = await cli . doInstall ( "test-package" ) ;
197+ const installResult = await cli . installPackage ( "test-package" ) ;
198198
199199 expect ( installResult ) . toBeUndefined ( ) ;
200200 expect ( readlineQuestionMock ) . toHaveBeenCalledTimes ( 1 ) ;
@@ -209,7 +209,7 @@ describe("doInstall", () => {
209209 readlineQuestionMock . mockImplementation ( ( _questionTest , cb ) => cb ( "No" ) ) ;
210210
211211 const mockExit = jest . spyOn ( process , "exit" ) . mockImplementation ( ( ) => { } ) ;
212- const installResult = await cli . doInstall ( "test-package" ) ;
212+ const installResult = await cli . installPackage ( "test-package" ) ;
213213
214214 expect ( installResult ) . toBeUndefined ( ) ;
215215 expect ( readlineQuestionMock ) . toHaveBeenCalledTimes ( 1 ) ;
0 commit comments