File tree Expand file tree Collapse file tree 1 file changed +7
-16
lines changed
packages/bundle-size/src/reporters Expand file tree Collapse file tree 1 file changed +7
-16
lines changed Original file line number Diff line number Diff line change 1- // Mock "chalk" to avoid special characters in output
2- /** @param {string } val */
3- function colorNoop ( val ) {
4- return val ;
5- }
6-
7- jest . mock ( 'chalk' , ( ) => ( {
8- bold : colorNoop ,
9-
10- cyan : colorNoop ,
11- green : colorNoop ,
12- red : colorNoop ,
13- } ) ) ;
1+ const chalk = require ( 'chalk' ) ;
2+ chalk . level = 0 ;
143
154const cliReporter = require ( './cliReporter' ) ;
165const sampleReport = require ( './sampleReport' ) ;
176
7+ function noop ( ) {
8+ /* does nothing */
9+ }
10+
1811describe ( 'cliReporter' , ( ) => {
1912 it ( 'renders a report to CLI output' , async ( ) => {
20- const log = jest . spyOn ( console , 'log' ) . mockImplementation ( ( ) => {
21- /* does nothing */
22- } ) ;
13+ const log = jest . spyOn ( console , 'log' ) . mockImplementation ( noop ) ;
2314 await cliReporter ( sampleReport ) ;
2415
2516 expect ( log . mock . calls [ 0 ] [ 0 ] ) . toMatchInlineSnapshot ( `
You can’t perform that action at this time.
0 commit comments