Skip to content

Commit 99b3817

Browse files
ludeknovyLudek Novydavidjgoss
committed
bringing back v6/5 props (#1732)
* bringing back v6/5 props * changelog update * Update CHANGELOG.md Co-authored-by: David Goss <[email protected]> Co-authored-by: Ludek Novy <[email protected]> Co-authored-by: David Goss <[email protected]>
1 parent 644d19a commit 99b3817

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO
2323

2424
* Prevent duplicate scenario execution where the same feature is targeted in multiple line expressions ([#1706](https://github.com/cucumber/cucumber-js/issues/1706))
2525
* Fixed reports banner to point to [new docs](https://cucumber.io/docs/cucumber/environment-variables/) about environment variables
26+
* Re-add color functions for use with custom formatters [1582](https://github.com/cucumber/cucumber-js/issues/1582)
2627
* IParameterTypeDefinition regexp fix [1702](https://github.com/cucumber/cucumber-js/issues/1702)
2728

2829
## [7.3.0] (2021-06-17)

src/formatter/get_color_fns.ts

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import _ from 'lodash'
21
import colors from 'colors/safe'
32
import { TestStepResultStatus } from '@cucumber/messages'
43

@@ -10,6 +9,10 @@ export interface IColorFns {
109
forStatus: (status: TestStepResultStatus) => IColorFn
1110
location: IColorFn
1211
tag: IColorFn
12+
diffAdded: IColorFn
13+
diffRemoved: IColorFn
14+
errorMessage: IColorFn
15+
errorStack: IColorFn
1316
}
1417

1518
export default function getColorFns(enabled: boolean): IColorFns {
@@ -28,14 +31,22 @@ export default function getColorFns(enabled: boolean): IColorFns {
2831
},
2932
location: colors.gray.bind(colors),
3033
tag: colors.cyan.bind(colors),
34+
diffAdded: colors.green.bind(colors),
35+
diffRemoved: colors.red.bind(colors),
36+
errorMessage: colors.red.bind(colors),
37+
errorStack: colors.grey.bind(colors),
3138
}
3239
} else {
3340
return {
3441
forStatus(status: TestStepResultStatus) {
35-
return _.identity
42+
return (x) => x
3643
},
37-
location: _.identity,
38-
tag: _.identity,
44+
location: (x) => x,
45+
tag: (x) => x,
46+
diffAdded: (x) => x,
47+
diffRemoved: (x) => x,
48+
errorMessage: (x) => x,
49+
errorStack: (x) => x,
3950
}
4051
}
4152
}

0 commit comments

Comments
 (0)