@@ -61,7 +61,7 @@ describe('instance methods', () => {
6161 command . argv = [ 'hello' ]
6262 return command . run ( )
6363 . then ( ( ) => {
64- expect ( cmd ) . toHaveBeenCalledWith ( 'hello' )
64+ expect ( cmd ) . toHaveBeenCalledWith ( { code : false , name : 'hello' } )
6565 expect ( stdout . output ) . toMatch ( '' )
6666 } )
6767 } )
@@ -192,7 +192,7 @@ describe('instance methods', () => {
192192 command . argv = [ 'hello' ]
193193 return command . run ( )
194194 . then ( ( ) => {
195- expect ( cmd ) . toHaveBeenCalledWith ( 'hello' )
195+ expect ( cmd ) . toHaveBeenCalledWith ( { code : false , name : 'hello' } )
196196 expect ( stdout . output ) . toMatch ( '' ) // TODO: json output
197197 } )
198198 } )
@@ -220,7 +220,7 @@ describe('instance methods', () => {
220220 command . argv = [ 'hello' , '--save' ]
221221 return command . run ( )
222222 . then ( ( ) => {
223- expect ( cmd ) . toHaveBeenCalledWith ( 'hello' )
223+ expect ( cmd ) . toHaveBeenCalledWith ( { code : true , name : 'hello' } )
224224 expect ( fs . writeFileSync ) . toHaveBeenCalledWith ( 'hello.js' , 'this is the code' )
225225 } )
226226 } )
@@ -231,7 +231,7 @@ describe('instance methods', () => {
231231 command . argv = [ 'pkg/hello' , '--save' ]
232232 return command . run ( )
233233 . then ( ( ) => {
234- expect ( cmd ) . toHaveBeenCalledWith ( 'pkg/hello' )
234+ expect ( cmd ) . toHaveBeenCalledWith ( { code : true , name : 'pkg/hello' } )
235235 expect ( fs . writeFileSync ) . toHaveBeenCalledWith ( 'hello.js' , 'this is the code' )
236236 } )
237237 } )
@@ -242,7 +242,7 @@ describe('instance methods', () => {
242242 command . argv = [ 'hello' , '--save-as' , 'filename.js' ]
243243 return command . run ( )
244244 . then ( ( ) => {
245- expect ( cmd ) . toHaveBeenCalledWith ( 'hello' )
245+ expect ( cmd ) . toHaveBeenCalledWith ( { code : true , name : 'hello' } )
246246 expect ( fs . writeFileSync ) . toHaveBeenCalledWith ( 'filename.js' , 'this is the code' )
247247 } )
248248 } )
@@ -253,7 +253,7 @@ describe('instance methods', () => {
253253 command . argv = [ 'hello' , '--save' ]
254254 return command . run ( )
255255 . then ( ( ) => {
256- expect ( cmd ) . toHaveBeenCalledWith ( 'hello' )
256+ expect ( cmd ) . toHaveBeenCalledWith ( { code : true , name : 'hello' } )
257257 expect ( fs . writeFileSync ) . toHaveBeenCalledWith ( 'hello.zip' ,
258258 bufferData , 'buffer' )
259259 } )
@@ -265,7 +265,7 @@ describe('instance methods', () => {
265265 command . argv = [ 'hello' , '--save-as' , 'filename.zip' ]
266266 return command . run ( )
267267 . then ( ( ) => {
268- expect ( cmd ) . toHaveBeenCalledWith ( 'hello' )
268+ expect ( cmd ) . toHaveBeenCalledWith ( { code : true , name : 'hello' } )
269269 expect ( fs . writeFileSync ) . toHaveBeenCalledWith ( 'filename.zip' ,
270270 bufferData , 'buffer' )
271271 } )
@@ -277,7 +277,7 @@ describe('instance methods', () => {
277277 command . argv = [ 'hello' ]
278278 return command . run ( )
279279 . then ( ( ) => {
280- expect ( cmd ) . toHaveBeenCalledWith ( 'hello' )
280+ expect ( cmd ) . toHaveBeenCalledWith ( { name : 'hello' , code : true } )
281281 const result = JSON . parse ( stdout . output )
282282 delete result . date
283283 expect ( `${ JSON . stringify ( result , null , 2 ) } \n` ) . toMatchFixture ( 'action/get.json' )
@@ -290,7 +290,7 @@ describe('instance methods', () => {
290290 command . argv = [ 'hello' , '--code' ]
291291 return command . run ( )
292292 . then ( ( ) => {
293- expect ( cmd ) . toHaveBeenCalledWith ( 'hello' )
293+ expect ( cmd ) . toHaveBeenCalledWith ( { code : true , name : 'hello' } )
294294 expect ( stdout . output ) . toMatch ( 'this is the code' )
295295 } )
296296 } )
0 commit comments