Skip to content

Commit 824d65d

Browse files
committed
fix: update chalk mock to use Object.assign for better compatibility
1 parent 16b8fe1 commit 824d65d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

__mocks__/chalk.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const chalk = {
1+
const chalk = Object.assign((text) => text, {
22
green: (text) => text,
33
red: (text) => text,
44
yellow: (text) => text,
@@ -38,6 +38,6 @@ const chalk = {
3838
inverse: (text) => text,
3939
strikethrough: (text) => text,
4040
reset: (text) => text,
41-
};
41+
});
4242

4343
module.exports = chalk;

jest.config.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@ module.exports = {
3939
moduleNameMapper: {
4040
'^chalk$': '<rootDir>/__mocks__/chalk.js',
4141
},
42+
forceExit: true,
4243
};

0 commit comments

Comments
 (0)