Skip to content

Commit 77e42cc

Browse files
author
Hanna
committed
Address the dependency malicious issue.
Issue description: npm:chalk:0.0.0-ANY is malicious MAL-2025-46969, Score: 10 Replaced with safe alternative: colorette: "^2.0.20"
1 parent aba5740 commit 77e42cc

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"@testing-library/jest-dom": "^5.11.6",
5353
"@types/react": "^19.0.0",
5454
"@types/react-dom": "^19.0.0",
55-
"chalk": "^4.1.2",
55+
"colorette": "^2.0.20",
5656
"dotenv-cli": "^4.0.0",
5757
"jest-diff": "^29.7.0",
5858
"kcd-scripts": "^13.0.0",

tests/failOnUnexpectedConsoleCalls.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ SOFTWARE.
2525
/* eslint-disable prefer-template */
2626
/* eslint-disable func-names */
2727
const util = require('util')
28-
const chalk = require('chalk')
28+
const colorette = require('colorette')
2929
const shouldIgnoreConsoleError = require('./shouldIgnoreConsoleError')
3030

3131
const patchConsoleMethod = (methodName, unexpectedConsoleCallStacks) => {
@@ -69,23 +69,23 @@ const flushUnexpectedConsoleCalls = (
6969
if (unexpectedConsoleCallStacks.length > 0) {
7070
const messages = unexpectedConsoleCallStacks.map(
7171
([stack, message]) =>
72-
`${chalk.red(message)}\n` +
72+
`${colorette.red(message)}\n` +
7373
`${stack
7474
.split('\n')
75-
.map(line => chalk.gray(line))
75+
.map(line => colorette.gray(line))
7676
.join('\n')}`,
7777
)
7878

7979
const message =
80-
`Expected test not to call ${chalk.bold(
80+
`Expected test not to call ${colorette.bold(
8181
`console.${methodName}()`,
8282
)}.\n\n` +
8383
'If the warning is expected, test for it explicitly by:\n' +
84-
`1. Using the ${chalk.bold('.' + expectedMatcher + '()')} ` +
84+
`1. Using the ${colorette.bold('.' + expectedMatcher + '()')} ` +
8585
`matcher, or...\n` +
86-
`2. Mock it out using ${chalk.bold(
86+
`2. Mock it out using ${colorette.bold(
8787
'spyOnDev',
88-
)}(console, '${methodName}') or ${chalk.bold(
88+
)}(console, '${methodName}') or ${colorette.bold(
8989
'spyOnProd',
9090
)}(console, '${methodName}'), and test that the warning occurs.`
9191

0 commit comments

Comments
 (0)