Skip to content

Commit

Permalink
fix(prefer-importing-jest-globals): fix indenting
Browse files Browse the repository at this point in the history
  • Loading branch information
ezimmer-atlassian committed Sep 2, 2024
1 parent 090fd91 commit 2f99c06
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions src/rules/__tests__/prefer-importing-jest-globals.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,22 +548,22 @@ ruleTester.run('prefer-importing-jest-globals', rule, {
},
{
code: dedent`
console.log('hello');
const onClick = jest.fn();
describe("suite", () => {
test("foo");
expect(onClick).toHaveBeenCalled();
})
`,
console.log('hello');
const onClick = jest.fn();
describe("suite", () => {
test("foo");
expect(onClick).toHaveBeenCalled();
})
`,
output: dedent`
console.log('hello');
const { describe, expect, jest, test } = require('@jest/globals');
const onClick = jest.fn();
describe("suite", () => {
test("foo");
expect(onClick).toHaveBeenCalled();
})
`,
console.log('hello');
const { describe, expect, jest, test } = require('@jest/globals');
const onClick = jest.fn();
describe("suite", () => {
test("foo");
expect(onClick).toHaveBeenCalled();
})
`,
errors: [
{
endColumn: 21,
Expand All @@ -575,21 +575,21 @@ ruleTester.run('prefer-importing-jest-globals', rule, {
},
{
code: dedent`
console.log('hello');
const onClick = jest.fn();
describe("suite", () => {
test("foo");
expect(onClick).toHaveBeenCalled();
})
console.log('hello');
const onClick = jest.fn();
describe("suite", () => {
test("foo");
expect(onClick).toHaveBeenCalled();
})
`,
output: dedent`
import { describe, expect, jest, test } from '@jest/globals';
console.log('hello');
const onClick = jest.fn();
describe("suite", () => {
test("foo");
expect(onClick).toHaveBeenCalled();
})
import { describe, expect, jest, test } from '@jest/globals';
console.log('hello');
const onClick = jest.fn();
describe("suite", () => {
test("foo");
expect(onClick).toHaveBeenCalled();
})
`,
parserOptions: { sourceType: 'module' },
errors: [
Expand Down

0 comments on commit 2f99c06

Please # to comment.