Skip to content

Commit 0703f83

Browse files
committed
import Color from chalk rather than hard coding
1 parent 26183ce commit 0703f83

File tree

2 files changed

+4
-43
lines changed

2 files changed

+4
-43
lines changed

packages/jest-types/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"dependencies": {
1616
"@types/istanbul-lib-coverage": "^2.0.0",
1717
"@types/istanbul-reports": "^1.1.1",
18-
"@types/yargs": "^13.0.0"
18+
"@types/yargs": "^13.0.0",
19+
"chalk": "^3.0.0"
1920
},
2021
"publishConfig": {
2122
"access": "public"

packages/jest-types/src/Config.ts

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import {Arguments} from 'yargs';
99
import {ReportOptions} from 'istanbul-reports';
10+
import chalk = require('chalk');
1011

1112
export type Path = string;
1213

@@ -112,7 +113,7 @@ export type DisplayName =
112113
| string
113114
| {
114115
name: string;
115-
color: DisplayNameColor;
116+
color: typeof chalk.Color;
116117
};
117118

118119
export type InitialOptionsWithRootDir = InitialOptions &
@@ -240,47 +241,6 @@ type NotifyMode =
240241
| 'success-change'
241242
| 'failure-change';
242243

243-
/**
244-
* Hard coding this until
245-
* https://github.com/chalk/chalk/pull/336
246-
* gets merged
247-
*/
248-
type DisplayNameColor =
249-
| 'black'
250-
| 'red'
251-
| 'green'
252-
| 'yellow'
253-
| 'blue'
254-
| 'magenta'
255-
| 'cyan'
256-
| 'white'
257-
| 'gray'
258-
| 'grey'
259-
| 'blackBright'
260-
| 'redBright'
261-
| 'greenBright'
262-
| 'yellowBright'
263-
| 'blueBright'
264-
| 'magentaBright'
265-
| 'cyanBright'
266-
| 'whiteBright'
267-
| 'bgBlack'
268-
| 'bgRed'
269-
| 'bgGreen'
270-
| 'bgYellow'
271-
| 'bgBlue'
272-
| 'bgMagenta'
273-
| 'bgCyan'
274-
| 'bgWhite'
275-
| 'bgBlackBright'
276-
| 'bgRedBright'
277-
| 'bgGreenBright'
278-
| 'bgYellowBright'
279-
| 'bgBlueBright'
280-
| 'bgMagentaBright'
281-
| 'bgCyanBright'
282-
| 'bgWhiteBright';
283-
284244
export type CoverageThresholdValue = {
285245
branches?: number;
286246
functions?: number;

0 commit comments

Comments
 (0)