File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ const languageCodes = Object.keys(languages)
42
42
// This is a string that contributors can use in markdown and yaml files as a placeholder.
43
43
// If any placeholders slip through, this test will flag them.
44
44
const placeholder = 'TODOCS'
45
- const placeholderRegex = new RegExp ( `\\b${ placeholder } \\b` , 'g ' )
45
+ const placeholderRegex = new RegExp ( `\\b${ placeholder } \\b` , 'gi ' )
46
46
47
47
// WARNING: Complicated RegExp below!
48
48
//
@@ -480,8 +480,11 @@ describe('lint markdown content', () => {
480
480
481
481
test ( 'placeholder string is not present in any markdown files' , async ( ) => {
482
482
const matches = rawContent . match ( placeholderRegex ) || [ ]
483
+ const placeholderStr = matches . length === 1 ? 'placeholder' : 'placeholders'
483
484
const errorMessage = `
484
- Found ${ matches . length } placeholder string '${ placeholder } ' in this file! Please update all placeholders.
485
+ Found ${ matches . length } ${ placeholderStr } '${ matches . join (
486
+ ', '
487
+ ) } ' in this file! Please update all placeholders.
485
488
`
486
489
expect ( matches . length , errorMessage ) . toBe ( 0 )
487
490
} )
You can’t perform that action at this time.
0 commit comments