Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yeonjuan committed Dec 18, 2024
1 parent 7d90204 commit 1bb3a09
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/eslint-plugin/tests/rules/require-input-label.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const createRuleTester = require("../rule-tester");
const rule = require("../../lib/rules/require-input-label");

const ruleTester = createRuleTester();
const templateRuleTester = createRuleTester("espree");

ruleTester.run("require-input-label", rule, {
valid: [
Expand Down Expand Up @@ -51,3 +52,21 @@ ruleTester.run("require-input-label", rule, {
},
],
});

templateRuleTester.run("[template] require-input-label", rule, {
valid: [
{
code: `html\`<input id="foo">\``,
},
],
invalid: [
{
code: `html\`<input type="text">\``,
errors: [
{
messageId: "missingLabel",
},
],
},
],
});

0 comments on commit 1bb3a09

Please sign in to comment.