@@ -60,7 +60,7 @@ describe('lib/cli/commands/remove-unused-screens', () => {
6060 findScreens = sandbox . stub ( ) . resolves ( [ ] ) ;
6161 askConfirm = sandbox . stub ( ) . resolves ( true ) ;
6262 identifyOutdatedScreens = sandbox . stub ( ) . returns ( [ ] ) ;
63- identifyUnusedScreens = sandbox . stub ( ) . returns ( [ ] ) ;
63+ identifyUnusedScreens = sandbox . stub ( ) . resolves ( [ ] ) ;
6464 removeScreens = sandbox . stub ( ) . resolves ( ) ;
6565
6666 filesizeMock = sandbox . stub ( ) . returns ( '12345' ) ;
@@ -439,7 +439,7 @@ describe('lib/cli/commands/remove-unused-screens', () => {
439439
440440 it ( 'should not throw if unused screen does not exist on fs' , async ( ) => {
441441 findScreens . resolves ( [ '/root/broId/testId/1.png' , '/root/broId/unusedTestId/2.png' ] ) ;
442- identifyUnusedScreens . returns ( [ '/root/broId/unusedTestId/2.png' ] ) ;
442+ identifyUnusedScreens . resolves ( [ '/root/broId/unusedTestId/2.png' ] ) ;
443443
444444 const accessError = new Error ( 'file does not exist' ) ;
445445 accessError . code = 'ENOENT' ;
@@ -453,7 +453,7 @@ describe('lib/cli/commands/remove-unused-screens', () => {
453453
454454 it ( 'should inform user about the number of unused screens' , async ( ) => {
455455 findScreens . resolves ( [ '/root/usedTestId/img.png' , '/root/unusedTestId/img.png' ] ) ;
456- identifyUnusedScreens . returns ( [ '/root/unusedTestId/img.png' ] ) ;
456+ identifyUnusedScreens . resolves ( [ '/root/unusedTestId/img.png' ] ) ;
457457
458458 await removeUnusedScreens_ ( { toolAdapter, program} ) ;
459459
@@ -462,7 +462,7 @@ describe('lib/cli/commands/remove-unused-screens', () => {
462462
463463 describe ( 'size calculation of unused images' , ( ) => {
464464 beforeEach ( ( ) => {
465- identifyUnusedScreens . returns ( [ '/root/unusedTestId/1.png' , '/root/unusedTestId/2.png' ] ) ;
465+ identifyUnusedScreens . resolves ( [ '/root/unusedTestId/1.png' , '/root/unusedTestId/2.png' ] ) ;
466466
467467 fs . stat . withArgs ( '/root/unusedTestId/1.png' ) . resolves ( { size : 10 } ) ;
468468 fs . stat . withArgs ( '/root/unusedTestId/2.png' ) . resolves ( { size : 20 } ) ;
@@ -485,7 +485,7 @@ describe('lib/cli/commands/remove-unused-screens', () => {
485485
486486 describe ( 'show list of unused images' , ( ) => {
487487 beforeEach ( ( ) => {
488- identifyUnusedScreens . returns ( [ '/root/unusedTestId/1.png' , '/root/unusedTestId/2.png' ] ) ;
488+ identifyUnusedScreens . resolves ( [ '/root/unusedTestId/1.png' , '/root/unusedTestId/2.png' ] ) ;
489489 } ) ;
490490
491491 it ( 'should ask user about it' , async ( ) => {
@@ -519,7 +519,7 @@ describe('lib/cli/commands/remove-unused-screens', () => {
519519
520520 describe ( 'remove unused images' , ( ) => {
521521 it ( 'should ask user about it' , async ( ) => {
522- identifyUnusedScreens . returns ( [ '/root/unusedTestId/1.png' , '/root/unusedTestId/2.png' ] ) ;
522+ identifyUnusedScreens . resolves ( [ '/root/unusedTestId/1.png' , '/root/unusedTestId/2.png' ] ) ;
523523
524524 await removeUnusedScreens_ ( { program} ) ;
525525
@@ -531,7 +531,7 @@ describe('lib/cli/commands/remove-unused-screens', () => {
531531
532532 it ( 'should not remove if user say "no"' , async ( ) => {
533533 askConfirm . withArgs ( sinon . match ( { message : 'Remove unused reference images?' } ) , program . options ) . resolves ( false ) ;
534- identifyUnusedScreens . returns ( [ '/root/unusedTestId/1.png' , '/root/unusedTestId/2.png' ] ) ;
534+ identifyUnusedScreens . resolves ( [ '/root/unusedTestId/1.png' , '/root/unusedTestId/2.png' ] ) ;
535535
536536 await removeUnusedScreens_ ( { program} ) ;
537537
@@ -540,7 +540,7 @@ describe('lib/cli/commands/remove-unused-screens', () => {
540540
541541 it ( 'should remove if user say "yes"' , async ( ) => {
542542 const unusedScreens = [ '/root/unusedTestId/1.png' , '/root/unusedTestId/2.png' ] ;
543- identifyUnusedScreens . returns ( unusedScreens ) ;
543+ identifyUnusedScreens . resolves ( unusedScreens ) ;
544544 askConfirm . withArgs ( sinon . match ( { message : 'Remove unused reference images?' } ) , program . options ) . resolves ( true ) ;
545545
546546 await removeUnusedScreens_ ( { program} ) ;
0 commit comments