Skip to content

Commit

Permalink
Chore: Correct the invalid tests in no-empty-function for use with me…
Browse files Browse the repository at this point in the history
…ssageIds
  • Loading branch information
j-f1 committed Sep 14, 2017
1 parent ca75b44 commit 5d9dc42
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions tests/lib/cli-engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,7 @@ describe("CLIEngine", () => {
column: 9,
line: 2,
message: "Expected '===' and instead saw '=='.",
messageId: "unexpected",
nodeType: "BinaryExpression",
ruleId: "eqeqeq",
severity: 2,
Expand Down
6 changes: 4 additions & 2 deletions tests/lib/rules/no-empty-function.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ function toValidInvalid(patterns, item) {
}
);

const error = item.message || { messageId: item.messageId, data: item.data };

// Invalid Patterns.
patterns.invalid.push({
code: item.code,
errors: [item.message],
errors: [error],
parserOptions: { ecmaVersion: 6 }
});
ALLOW_OPTIONS
Expand All @@ -71,7 +73,7 @@ function toValidInvalid(patterns, item) {
// non related "allow" option has no effect.
patterns.invalid.push({
code: `${item.code} // allow: ${allow}`,
errors: [item.message],
errors: [error],
options: [{ allow: [allow] }],
parserOptions: { ecmaVersion: 6 }
});
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-extra-label.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ ruleTester.run("no-extra-label", rule, {
}
}
`,
errors: [{ message: { messageId: "unexpected", data: { name: "A" } }, type: "Identifier", line: 2 }]
errors: [{ messageId: "unexpected", data: { name: "A" }, type: "Identifier", line: 2 }]
}
]
});

0 comments on commit 5d9dc42

Please sign in to comment.