Improve error message for filename/title mismatch (#520)

This commit is contained in:
James Nylen 2019-01-07 20:40:24 -05:00 committed by GitHub
parent f09c3f48f7
commit 13ba307516
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -302,9 +302,9 @@ exports.parseFromDirectory = contentPath => {
filenameExpected.substring( 0, filenameBase.length + 1 ) !== filenameBase + '-'
) {
profileError(
'Expected filename "%s.md" for company "%s"',
filenameExpected,
companyName
'Company title "%s" doesn\'t match filename (expected ~ "%s.md")',
companyName,
filenameExpected
);
}

View file

@ -68,10 +68,10 @@ describe( 'validation errors', () => {
'10up.md: Expected 1 first-level heading but found 0',
'10up.md: The main title is wrapped inside of another element.',
'10up.md: Company name looks wrong: ""',
'17hats.md: Expected filename "a-company-called-17hats.md" for company "A company called 17hats"',
'17hats.md: Company title "A company called 17hats" doesn\'t match filename (expected ~ "a-company-called-17hats.md")',
'18f.md: Company name looks wrong: "$%$#%$"',
'and-yet.md: Expected 1 first-level heading but found 2',
'let-s-encrypt.md: Expected filename "lets-encrypt.md" for company "Let\'s Encrypt"',
'let-s-encrypt.md: Company title "Let\'s Encrypt" doesn\'t match filename (expected ~ "lets-encrypt.md")',
],
} );
} );