Skip to content

Commit ec3cb59

Browse files
committed
chore(jest-runner): replace chalk with picocolors
1 parent 0fd1645 commit ec3cb59

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

packages/jest-runner/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"@jest/transform": "workspace:*",
2626
"@jest/types": "workspace:*",
2727
"@types/node": "*",
28-
"chalk": "^4.0.0",
2928
"emittery": "^0.13.1",
3029
"graceful-fs": "^4.2.9",
3130
"jest-docblock": "workspace:*",
@@ -39,6 +38,7 @@
3938
"jest-watcher": "workspace:*",
4039
"jest-worker": "workspace:*",
4140
"p-limit": "^3.1.0",
41+
"picocolors": "^1.0.1",
4242
"source-map-support": "0.5.13"
4343
},
4444
"devDependencies": {

packages/jest-runner/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
import chalk = require('chalk');
98
import Emittery = require('emittery');
109
import pLimit = require('p-limit');
10+
import * as pico from 'picocolors';
1111
import type {
1212
Test,
1313
TestEvents,
@@ -184,7 +184,7 @@ export default class TestRunner extends EmittingTestRunner {
184184
const {forceExited} = await worker.end();
185185
if (forceExited) {
186186
console.error(
187-
chalk.yellow(
187+
pico.yellow(
188188
'A worker process has failed to exit gracefully and has been force exited. ' +
189189
'This is likely caused by tests leaking due to improper teardown. ' +
190190
'Try running with --detectOpenHandles to find leaks. ' +

packages/jest-runner/src/runTest.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
*
77
*/
88

9-
import chalk = require('chalk');
109
import * as fs from 'graceful-fs';
10+
import * as pico from 'picocolors';
1111
import sourcemapSupport = require('source-map-support');
1212
import {
1313
BufferedConsole,
@@ -45,8 +45,8 @@ function freezeConsole(
4545
message: LogMessage,
4646
) {
4747
const error = new ErrorWithStack(
48-
`${chalk.red(
49-
`${chalk.bold(
48+
`${pico.red(
49+
`${pico.bold(
5050
'Cannot log after tests are done.',
5151
)} Did you forget to wait for something async in your test?`,
5252
)}\nAttempted to log "${message}".`,

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13424,7 +13424,6 @@ __metadata:
1342413424
"@types/graceful-fs": ^4.1.3
1342513425
"@types/node": "*"
1342613426
"@types/source-map-support": ^0.5.0
13427-
chalk: ^4.0.0
1342813427
emittery: ^0.13.1
1342913428
graceful-fs: ^4.2.9
1343013429
jest-docblock: "workspace:*"
@@ -13439,6 +13438,7 @@ __metadata:
1343913438
jest-watcher: "workspace:*"
1344013439
jest-worker: "workspace:*"
1344113440
p-limit: ^3.1.0
13441+
picocolors: ^1.0.1
1344213442
source-map-support: 0.5.13
1344313443
languageName: unknown
1344413444
linkType: soft

0 commit comments

Comments
 (0)