66 */
77
88import * as path from 'path' ;
9- import chalk = require( 'chalk' ) ;
109import exit = require( 'exit' ) ;
10+ import * as pico from 'picocolors' ;
1111import yargs = require( 'yargs' ) ;
1212import { getVersion , runCLI } from '@jest/core' ;
1313import type { AggregatedResult } from '@jest/test-result' ;
@@ -31,9 +31,9 @@ export async function run(
3131 clearLine ( process . stderr ) ;
3232 clearLine ( process . stdout ) ;
3333 if ( error ?. stack ) {
34- console . error ( chalk . red ( error . stack ) ) ;
34+ console . error ( pico . red ( error . stack ) ) ;
3535 } else {
36- console . error ( chalk . red ( error ) ) ;
36+ console . error ( pico . red ( error ) ) ;
3737 }
3838
3939 exit ( 1 ) ;
@@ -117,7 +117,7 @@ const readResultsAndExit = (
117117 if ( globalConfig . forceExit ) {
118118 if ( ! globalConfig . detectOpenHandles ) {
119119 console . warn (
120- `${ chalk . bold (
120+ `${ pico . bold (
121121 'Force exiting Jest: ' ,
122122 ) } Have you considered using \`--detectOpenHandles\` to detect ` +
123123 'async operations that kept running after all tests finished?' ,
@@ -132,12 +132,14 @@ const readResultsAndExit = (
132132 const timeout = globalConfig . openHandlesTimeout ;
133133 setTimeout ( ( ) => {
134134 console . warn (
135- chalk . yellow . bold (
136- `Jest did not exit ${
137- timeout === 1000 ? 'one second' : `${ timeout / 1000 } seconds`
138- } after the test run has completed.\n\n'`,
135+ pico . yellow (
136+ pico . bold (
137+ `Jest did not exit ${
138+ timeout === 1000 ? 'one second' : `${ timeout / 1000 } seconds`
139+ } after the test run has completed.\n\n'`,
140+ ) ,
139141 ) +
140- chalk . yellow (
142+ pico . yellow (
141143 'This usually means that there are asynchronous operations that ' +
142144 "weren't stopped in your tests. Consider running Jest with " +
143145 '`--detectOpenHandles` to troubleshoot this issue.' ,
0 commit comments