Skip to content

Commit

Permalink
fix: Ensure all RuleTester tests all deprecated context methods (#17587)
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas committed Sep 20, 2023
1 parent 1800537 commit 1ea4cfb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 6 additions & 1 deletion lib/rule-tester/rule-tester.js
Expand Up @@ -186,7 +186,12 @@ const DEPRECATED_SOURCECODE_PASSTHROUGHS = {
getTokens: "getTokens",
getTokensAfter: "getTokensAfter",
getTokensBefore: "getTokensBefore",
getTokensBetween: "getTokensBetween"
getTokensBetween: "getTokensBetween",

getScope: "getScope",
getAncestors: "getAncestors",
getDeclaredVariables: "getDeclaredVariables",
markVariableAsUsed: "markVariableAsUsed"
};

/**
Expand Down
7 changes: 5 additions & 2 deletions tests/lib/rule-tester/rule-tester.js
Expand Up @@ -2534,10 +2534,13 @@ describe("RuleTester", () => {
getTokens: "getTokens",
getTokensAfter: "getTokensAfter",
getTokensBefore: "getTokensBefore",
getTokensBetween: "getTokensBetween"
getTokensBetween: "getTokensBetween",
getScope: "getScope",
getAncestors: "getAncestors",
getDeclaredVariables: "getDeclaredVariables",
markVariableAsUsed: "markVariableAsUsed"
}).forEach(([methodName, replacementName]) => {


it(`should log a deprecation warning when calling \`context.${methodName}\``, () => {
const ruleToCheckDeprecation = {
meta: {
Expand Down

0 comments on commit 1ea4cfb

Please sign in to comment.