Skip to content

Commit

Permalink
test: remove some trailing whitespace (#1560)
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath authored Apr 20, 2024
1 parent 462e336 commit ff36ec2
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 63 deletions.
14 changes: 7 additions & 7 deletions src/rules/__tests__/no-conditional-expect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ ruleTester.run('logical conditions', rule, {
{
code: `
function getValue() {
something && expect(something).toHaveBeenCalled();
something && expect(something).toHaveBeenCalled();
}
it('foo', getValue);
Expand Down Expand Up @@ -162,7 +162,7 @@ ruleTester.run('logical conditions', rule, {
{
code: `
function getValue() {
something || expect(something).toHaveBeenCalled();
something || expect(something).toHaveBeenCalled();
}
it('foo', getValue);
Expand Down Expand Up @@ -512,7 +512,7 @@ ruleTester.run('catch conditions', rule, {
code: `
it('foo', () => {
try {
} catch (err) {
expect(err).toMatch('Error');
}
Expand All @@ -524,7 +524,7 @@ ruleTester.run('catch conditions', rule, {
code: `
it.each\`\`('foo', () => {
try {
} catch (err) {
expect(err).toMatch('Error');
}
Expand All @@ -536,7 +536,7 @@ ruleTester.run('catch conditions', rule, {
code: `
it.each()('foo', () => {
try {
} catch (err) {
expect(err).toMatch('Error');
}
Expand All @@ -548,7 +548,7 @@ ruleTester.run('catch conditions', rule, {
code: `
it.skip.each\`\`('foo', () => {
try {
} catch (err) {
expect(err).toMatch('Error');
}
Expand All @@ -560,7 +560,7 @@ ruleTester.run('catch conditions', rule, {
code: `
it.skip.each()('foo', () => {
try {
} catch (err) {
expect(err).toMatch('Error');
}
Expand Down
2 changes: 1 addition & 1 deletion src/rules/__tests__/no-conditional-in-test.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ ruleTester.run('switch statements', rule, {
return thing.bar;
}
});
switch('invalid') {
case true:
expect(values).toStrictEqual(['foo']);
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/prefer-each.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ ruleTester.run('prefer-each', rule, {
for (const [input, expected] of data) {
it("only returns numbers that are greater than seven", function () {
const numbers = getNumbers(input);
for (let i = 0; i < numbers.length; i++) {
expect(numbers[i]).toBeGreaterThan(7);
}
Expand All @@ -291,7 +291,7 @@ ruleTester.run('prefer-each', rule, {
it("only returns numbers that are greater than seven", function () {
const numbers = getNumbers();
for (let i = 0; i < numbers.length; i++) {
expect(numbers[i]).toBeGreaterThan(7);
}
Expand Down
74 changes: 37 additions & 37 deletions src/rules/__tests__/prefer-hooks-in-order.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,47 +181,47 @@ ruleTester.run('prefer-hooks-in-order', rule, {
beforeAll(() => {
createMyDatabase();
});
beforeEach(() => {
seedMyDatabase();
});
it('accepts this input', () => {
// ...
});
it('returns that value', () => {
// ...
});
describe('when the database has specific values', () => {
const specificValue = '...';
beforeEach(() => {
seedMyDatabase(specificValue);
});
it('accepts that input', () => {
// ...
});
it('throws an error', () => {
// ...
});
beforeEach(() => {
mockLogger();
});
afterEach(() => {
clearLogger();
});
it('logs a message', () => {
// ...
});
});
afterAll(() => {
removeMyDatabase();
});
Expand All @@ -233,35 +233,35 @@ ruleTester.run('prefer-hooks-in-order', rule, {
setupTheDatabase();
createMocks();
});
beforeAll(() => {
doEvenMore();
});
beforeEach(() => {
cleanTheDatabase();
resetSomeThings();
});
afterEach(() => {
cleanTheDatabase();
resetSomeThings();
});
afterAll(() => {
closeTheDatabase();
stop();
});
it('does something', () => {
const thing = getThing();
expect(thing).toBe('something');
});
it('throws', () => {
// Do something that throws
});
describe('Also have tests in here', () => {
afterAll(() => {});
it('tests something', () => {});
Expand Down Expand Up @@ -539,25 +539,25 @@ ruleTester.run('prefer-hooks-in-order', rule, {
beforeAll(() => {});
beforeAll(() => {});
afterAll(() => {});
it('foo nested', () => {
// this is a test
});
describe('when something is true', () => {
beforeAll(() => {});
afterEach(() => {});
it('foo nested', () => {
// this is a test
});
describe('deeply nested', () => {
describe('deeply nested', () => {
afterAll(() => {});
afterAll(() => {});
// This comment does nothing
afterEach(() => {});
it('foo nested', () => {
// this is a test
});
Expand Down Expand Up @@ -588,15 +588,15 @@ ruleTester.run('prefer-hooks-in-order', rule, {
setupMocks();
});
};
it('foo', () => {
// this is a test
});
describe('my nested test', () => {
afterAll(() => {});
afterEach(() => {});
it('foo nested', () => {
// this is a test
});
Expand Down Expand Up @@ -624,47 +624,47 @@ ruleTester.run('prefer-hooks-in-order', rule, {
beforeEach(() => {
seedMyDatabase();
});
beforeAll(() => {
createMyDatabase();
});
it('accepts this input', () => {
// ...
});
it('returns that value', () => {
// ...
});
describe('when the database has specific values', () => {
const specificValue = '...';
beforeEach(() => {
seedMyDatabase(specificValue);
});
it('accepts that input', () => {
// ...
});
it('throws an error', () => {
// ...
});
afterEach(() => {
clearLogger();
});
beforeEach(() => {
mockLogger();
});
it('logs a message', () => {
// ...
});
});
afterAll(() => {
removeMyDatabase();
});
Expand Down
2 changes: 1 addition & 1 deletion src/rules/__tests__/prefer-snapshot-hint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ ruleTester.run('prefer-snapshot-hint (always)', rule, {
},
{
code: dedent`
const x = "we can't know if this is a string or not";
const x = "we can't know if this is a string or not";
expect(1).toMatchSnapshot(x);
`,
options: ['always'],
Expand Down
10 changes: 5 additions & 5 deletions src/rules/__tests__/require-hook.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ ruleTester.run('require-hook', rule, {
let consoleLogSpy;
beforeEach(() => {
consoleLogSpy = jest.spyOn(console, 'log');
consoleLogSpy = jest.spyOn(console, 'log');
});
it('prints a message', () => {
Expand All @@ -95,14 +95,14 @@ ruleTester.run('require-hook', rule, {
});
`,
dedent`
let consoleErrorSpy = null;
let consoleErrorSpy = null;
beforeEach(() => {
consoleErrorSpy = jest.spyOn(console, 'error');
});
`,
dedent`
let consoleErrorSpy = undefined;
let consoleErrorSpy = undefined;
beforeEach(() => {
consoleErrorSpy = jest.spyOn(console, 'error');
Expand Down Expand Up @@ -154,7 +154,7 @@ ruleTester.run('require-hook', rule, {
{
code: dedent`
enableAutoDestroy(afterEach);
describe('some tests', () => {
it('is false', () => {
expect(true).toBe(true);
Expand Down Expand Up @@ -388,7 +388,7 @@ ruleTester.run('require-hook', rule, {
{
code: dedent`
enableAutoDestroy(afterEach);
describe('some tests', () => {
it('is false', () => {
expect(true).toBe(true);
Expand Down
Loading

0 comments on commit ff36ec2

Please sign in to comment.