@@ -6,8 +6,8 @@ import { testMocksDir } from '../../__tests__/fixtures.js';
66import { getListBundlesCommand , getListTabsCommand } from '../list.js' ;
77import { getCommandRunner } from './testingUtils.js' ;
88
9- vi . spyOn ( console , 'log' ) ;
10- vi . spyOn ( console , 'error' ) ;
9+ const mockedConsoleLog = vi . spyOn ( console , 'log' ) ;
10+ const mockedConsoleError = vi . spyOn ( console , 'error' ) ;
1111
1212describe ( 'Test list command with bundles' , ( ) => {
1313 const mockedResolveSingleBundle = vi . spyOn ( manifest , 'resolveSingleBundle' ) ;
@@ -18,7 +18,7 @@ describe('Test list command with bundles', () => {
1818 test ( 'Running command with no arguments' , async ( { expect } ) => {
1919 await expect ( runCommand ( ) ) . commandSuccess ( ) ;
2020 expect ( console . log ) . toHaveBeenCalledTimes ( 1 ) ;
21- const [ [ data ] ] = vi . mocked ( console . log ) . mock . calls ;
21+ const [ [ data ] ] = mockedConsoleLog . mock . calls ;
2222 expect ( data ) . toMatch ( / ^ D e t e c t e d 2 b u n d l e s i n .+ : \n 1 . t e s t 0 \n 2 . t e s t 1 $ / ) ;
2323 } ) ;
2424
@@ -30,7 +30,7 @@ describe('Test list command with bundles', () => {
3030 await expect ( runCommand ( ) ) . commandExit ( ) ;
3131
3232 expect ( console . error ) . toHaveBeenCalledTimes ( 1 ) ;
33- const [ [ data ] ] = vi . mocked ( console . error ) . mock . calls ;
33+ const [ [ data ] ] = mockedConsoleError . mock . calls ;
3434 expect ( data ) . toMatch ( / ^ N o b u n d l e s i n .+ $ / ) ;
3535 } ) ;
3636
@@ -43,7 +43,7 @@ describe('Test list command with bundles', () => {
4343 await expect ( runCommand ( `${ testMocksDir } /bundles/test0` ) ) . commandSuccess ( ) ;
4444
4545 expect ( console . log ) . toHaveBeenCalledTimes ( 1 ) ;
46- const [ [ data ] ] = vi . mocked ( console . log ) . mock . calls ;
46+ const [ [ data ] ] = mockedConsoleLog . mock . calls ;
4747 const sanitized = ( data as string ) . split ( '\n' ) . join ( '' ) ;
4848
4949 const match = / ^ .+ : ( \{ .+ \} ) $ / gm. exec ( sanitized ) ;
@@ -94,7 +94,7 @@ describe('Test list command with tabs', () => {
9494 await expect ( runCommand ( ) ) . commandSuccess ( ) ;
9595
9696 expect ( console . log ) . toHaveBeenCalledTimes ( 1 ) ;
97- const [ [ data ] ] = vi . mocked ( console . log ) . mock . calls ;
97+ const [ [ data ] ] = mockedConsoleLog . mock . calls ;
9898 expect ( data ) . toMatch ( / ^ D e t e c t e d 2 t a b s i n .+ : \n 1 . t a b 0 \n 2 . t a b 1 $ / ) ;
9999 } ) ;
100100
@@ -106,7 +106,7 @@ describe('Test list command with tabs', () => {
106106 await expect ( runCommand ( ) ) . commandExit ( ) ;
107107
108108 expect ( console . error ) . toHaveBeenCalledTimes ( 1 ) ;
109- const [ [ data ] ] = vi . mocked ( console . error ) . mock . calls ;
109+ const [ [ data ] ] = mockedConsoleError . mock . calls ;
110110 expect ( data ) . toMatch ( / ^ N o t a b s i n .+ $ / ) ;
111111 } ) ;
112112
@@ -119,7 +119,7 @@ describe('Test list command with tabs', () => {
119119 await expect ( runCommand ( `${ testMocksDir } /tabs/tab0` ) ) . commandSuccess ( ) ;
120120
121121 expect ( console . log ) . toHaveBeenCalledTimes ( 1 ) ;
122- const [ [ data ] ] = vi . mocked ( console . log ) . mock . calls ;
122+ const [ [ data ] ] = mockedConsoleLog . mock . calls ;
123123 expect ( data ) . toMatch ( / ^ T a b ' t a b 0 ' f o u n d i n .+ $ / ) ;
124124 } ) ;
125125} ) ;
0 commit comments