Skip to content

Commit

Permalink
chore(linter): add fixer test cases for prefer-dom-node-text-content (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jelly authored Jul 17, 2024
1 parent db2fd70 commit 4463eb4
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,13 @@ fn test() {
("for (const [{innerText}] of elements);", None),
];

Tester::new(PreferDomNodeTextContent::NAME, pass, fail).test_and_snapshot();
// TODO: implement a fixer for destructuring assignment cases
let fix = vec![
("node.innerText;", "node.textContent;"),
("node?.innerText;", "node?.textContent;"),
("node.innerText = 'foo';", "node.textContent = 'foo';"),
("innerText.innerText = 'foo';", "innerText.textContent = 'foo';"),
];

Tester::new(PreferDomNodeTextContent::NAME, pass, fail).expect_fix(fix).test_and_snapshot();
}

0 comments on commit 4463eb4

Please sign in to comment.