File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
packages/jest-each/src/table Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ const PRETTY_PLACEHOLDER = '%p';
17
17
const INDEX_PLACEHOLDER = '%#' ;
18
18
const NUMBER_PLACEHOLDER = '%$' ;
19
19
const PLACEHOLDER_PREFIX = '%' ;
20
- const ESCAPED_PLACEHOLDER_PREFIX = / % % / g ;
20
+ const ESCAPED_PLACEHOLDER_PREFIX = '%%' ;
21
21
const JEST_EACH_PLACEHOLDER_ESCAPE = '@@__JEST_EACH_PLACEHOLDER_ESCAPE__@@' ;
22
22
23
23
export default function array (
@@ -77,17 +77,11 @@ const formatTitle = (
77
77
rowIndex ,
78
78
) ,
79
79
)
80
- . replaceAll (
81
- new RegExp ( JEST_EACH_PLACEHOLDER_ESCAPE , 'g' ) ,
82
- PLACEHOLDER_PREFIX ,
83
- ) ;
80
+ . replaceAll ( JEST_EACH_PLACEHOLDER_ESCAPE , PLACEHOLDER_PREFIX ) ;
84
81
85
82
const normalisePlaceholderValue = ( value : unknown ) =>
86
83
typeof value === 'string'
87
- ? value . replaceAll (
88
- new RegExp ( PLACEHOLDER_PREFIX , 'g' ) ,
89
- JEST_EACH_PLACEHOLDER_ESCAPE ,
90
- )
84
+ ? value . replaceAll ( PLACEHOLDER_PREFIX , JEST_EACH_PLACEHOLDER_ESCAPE )
91
85
: value ;
92
86
93
87
const getMatchingPlaceholders = ( title : string ) =>
You can’t perform that action at this time.
0 commit comments