mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-29 20:18:49 +01:00
Add information about parser/index to error messages when parsing configuration file content.
This commit is contained in:
parent
925f9cd168
commit
7330ea4946
3 changed files with 10 additions and 6 deletions
|
|
@ -1321,7 +1321,7 @@ test.cb("configBadHybrid", (t) => {
|
|||
t.true(err instanceof Error, "Error not instance of Error.");
|
||||
t.truthy(err.message.match(
|
||||
// eslint-disable-next-line max-len
|
||||
/^Unable to parse '[^']*'; Unexpected token \S+ in JSON at position \d+;/
|
||||
/^Unable to parse '[^']*'; Parser \d+: Unexpected token \S+ in JSON at position \d+;/
|
||||
), "Error message unexpected.");
|
||||
t.true(!result, "Got result for bad child JSON.");
|
||||
t.end();
|
||||
|
|
@ -1390,7 +1390,8 @@ test("configBadJsonSync", (t) => {
|
|||
},
|
||||
{
|
||||
"message":
|
||||
/Unable to parse '[^']*'; Unexpected token \S+ in JSON at position \d+/
|
||||
// eslint-disable-next-line max-len
|
||||
/Unable to parse '[^']*'; Parser \d+: Unexpected token \S+ in JSON at position \d+/
|
||||
},
|
||||
"Did not get correct exception for bad JSON."
|
||||
);
|
||||
|
|
@ -1404,7 +1405,8 @@ test("configBadChildJsonSync", (t) => {
|
|||
},
|
||||
{
|
||||
"message":
|
||||
/Unable to parse '[^']*'; Unexpected token \S+ in JSON at position \d+/
|
||||
// eslint-disable-next-line max-len
|
||||
/Unable to parse '[^']*'; Parser \d+: Unexpected token \S+ in JSON at position \d+/
|
||||
},
|
||||
"Did not get correct exception for bad child JSON."
|
||||
);
|
||||
|
|
@ -1498,7 +1500,7 @@ test("configBadHybridSync", (t) => {
|
|||
},
|
||||
{
|
||||
// eslint-disable-next-line max-len
|
||||
"message": /^Unable to parse '[^']*'; Unexpected token \S+ in JSON at position \d+;/
|
||||
"message": /^Unable to parse '[^']*'; Parser \d+: Unexpected token \S+ in JSON at position \d+;/
|
||||
},
|
||||
"Did not get correct exception for bad content."
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue