Skip to content

Commit

Permalink
chore: fix getting scope in tests (#17899)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjermanovic committed Dec 22, 2023
1 parent 200518e commit a9a17b3
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions tests/lib/linter/linter.js
Expand Up @@ -824,8 +824,8 @@ describe("Linter", () => {

linter.defineRule("checker", {
create(context) {
spy = sinon.spy(() => {
const scope = context.getScope(),
spy = sinon.spy(node => {
const scope = context.sourceCode.getScope(node),
horse = getVariable(scope, "horse");

assert.isTrue(horse.eslintUsed);
Expand All @@ -846,8 +846,8 @@ describe("Linter", () => {

linter.defineRule("checker", {
create(context) {
spy = sinon.spy(() => {
const scope = context.getScope(),
spy = sinon.spy(node => {
const scope = context.sourceCode.getScope(node),
horse = getVariable(scope, "horse");

assert.notOk(horse.eslintUsed);
Expand All @@ -868,8 +868,8 @@ describe("Linter", () => {

linter.defineRule("checker", {
create(context) {
spy = sinon.spy(() => {
const scope = context.getScope();
spy = sinon.spy(node => {
const scope = context.sourceCode.getScope(node);

["horse", "dog"].forEach(name => {
assert.isTrue(getVariable(scope, name).eslintUsed);
Expand All @@ -891,8 +891,8 @@ describe("Linter", () => {

linter.defineRule("checker", {
create(context) {
spy = sinon.spy(() => {
const scope = context.getScope();
spy = sinon.spy(node => {
const scope = context.sourceCode.getScope(node);

["horse", "dog"].forEach(name => {
assert.notOk(getVariable(scope, name).eslintUsed);
Expand Down Expand Up @@ -9932,8 +9932,8 @@ describe("Linter with FlatConfigArray", () => {
rules: {
checker: {
create(context) {
spy = sinon.spy(() => {
const scope = context.getScope(),
spy = sinon.spy(node => {
const scope = context.sourceCode.getScope(node),
horse = getVariable(scope, "horse");

assert.isTrue(horse.eslintUsed);
Expand Down Expand Up @@ -9964,8 +9964,8 @@ describe("Linter with FlatConfigArray", () => {
rules: {
checker: {
create(context) {
spy = sinon.spy(() => {
const scope = context.getScope(),
spy = sinon.spy(node => {
const scope = context.sourceCode.getScope(node),
horse = getVariable(scope, "horse");

assert.notOk(horse.eslintUsed);
Expand Down Expand Up @@ -9996,8 +9996,8 @@ describe("Linter with FlatConfigArray", () => {
rules: {
checker: {
create(context) {
spy = sinon.spy(() => {
const scope = context.getScope();
spy = sinon.spy(node => {
const scope = context.sourceCode.getScope(node);

["horse", "dog"].forEach(name => {
assert.isTrue(getVariable(scope, name).eslintUsed);
Expand Down Expand Up @@ -10029,8 +10029,8 @@ describe("Linter with FlatConfigArray", () => {
rules: {
checker: {
create(context) {
spy = sinon.spy(() => {
const scope = context.getScope();
spy = sinon.spy(node => {
const scope = context.sourceCode.getScope(node);

["horse", "dog"].forEach(name => {
assert.notOk(getVariable(scope, name).eslintUsed);
Expand Down

0 comments on commit a9a17b3

Please sign in to comment.