Skip to content

Commit

Permalink
test(prefer-expect-assertions): format cases a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Jan 15, 2022
1 parent ab99a4e commit 6e5e94f
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions src/rules/__tests__/prefer-expect-assertions.test.ts
Expand Up @@ -21,7 +21,7 @@ ruleTester.run('prefer-expect-assertions', rule, {
it("it1", function() {
expect.assertions(1);
expect(someValue).toBe(true)
})
});
`,
'test("it1")',
'itHappensToStartWithIt("foo", function() {})',
Expand All @@ -34,7 +34,7 @@ ruleTester.run('prefer-expect-assertions', rule, {
for(let thing in things) {
expect(number).toBeGreaterThan(4);
}
})
});
`,
dedent`
it("returns numbers that are greater than four", function() {
Expand All @@ -43,22 +43,22 @@ ruleTester.run('prefer-expect-assertions', rule, {
for (let i = 0; i < things.length; i++) {
expect(number).toBeGreaterThan(4);
}
})
});
`,
{
code: dedent`
it("it1", async () => {
expect.assertions(1);
expect(someValue).toBe(true)
})
});
`,
options: [{ onlyFunctionsWithAsyncKeyword: true }],
},
{
code: dedent`
it("it1", function() {
expect(someValue).toBe(true)
})
});
`,
options: [{ onlyFunctionsWithAsyncKeyword: true }],
},
Expand All @@ -74,7 +74,7 @@ ruleTester.run('prefer-expect-assertions', rule, {
for(let thing in things) {
expect(number).toBeGreaterThan(4);
}
})
});
`,
options: [{ onlyFunctionsWithAsyncKeyword: true }],
},
Expand All @@ -84,7 +84,7 @@ ruleTester.run('prefer-expect-assertions', rule, {
for(let thing in things) {
expect(number).toBeGreaterThan(4);
}
})
});
`,
options: [{ onlyFunctionsWithAsyncKeyword: true }],
},
Expand Down Expand Up @@ -135,7 +135,7 @@ ruleTester.run('prefer-expect-assertions', rule, {
it("it1", function() {
someFunctionToDo();
someFunctionToDo2();
})
});
`,
errors: [
{
Expand All @@ -149,7 +149,7 @@ ruleTester.run('prefer-expect-assertions', rule, {
it("it1", function() {
expect.hasAssertions();someFunctionToDo();
someFunctionToDo2();
})
});
`,
},
{
Expand All @@ -158,7 +158,7 @@ ruleTester.run('prefer-expect-assertions', rule, {
it("it1", function() {
expect.assertions();someFunctionToDo();
someFunctionToDo2();
})
});
`,
},
],
Expand Down Expand Up @@ -263,7 +263,7 @@ ruleTester.run('prefer-expect-assertions', rule, {
someFunctionToDo();
someFunctionToDo2();
});
})
});
`,
errors: [
{
Expand All @@ -276,7 +276,7 @@ ruleTester.run('prefer-expect-assertions', rule, {
output: dedent`
it("it1", function() {
expect.hasAssertions();
})
});
`,
},
],
Expand All @@ -287,7 +287,7 @@ ruleTester.run('prefer-expect-assertions', rule, {
code: dedent`
it("it1", async function() {
expect(someValue).toBe(true);
})
});
`,
options: [{ onlyFunctionsWithAsyncKeyword: true }],
errors: [
Expand All @@ -304,7 +304,7 @@ ruleTester.run('prefer-expect-assertions', rule, {
for(let thing in things) {
expect(number).toBeGreaterThan(4);
}
})
});
`,
options: [{ onlyFunctionsWithAsyncKeyword: true }],
errors: [
Expand All @@ -321,7 +321,7 @@ ruleTester.run('prefer-expect-assertions', rule, {
for (const number of getNumbers()) {
expect(number).toBeGreaterThan(4);
}
})
});
`,
options: [{ onlyFunctionsWithAsyncKeyword: true }],
errors: [
Expand All @@ -338,13 +338,13 @@ ruleTester.run('prefer-expect-assertions', rule, {
for (const number of getNumbers()) {
expect(number).toBeGreaterThan(4);
}
})
});
it("returns numbers that are greater than five", () => {
for (const number of getNumbers()) {
expect(number).toBeGreaterThan(5);
}
})
});
`,
options: [{ onlyFunctionsWithAsyncKeyword: true }],
errors: [
Expand Down Expand Up @@ -446,7 +446,7 @@ ruleTester.run('prefer-expect-assertions (loops)', rule, {
for (let i = 0; i < numbers.length; i++) {
expect(numbers[i]).toBeGreaterThan(7);
}
})
});
`,
options: [{ onlyFunctionsWithExpectInLoop: true }],
errors: [
Expand All @@ -461,7 +461,7 @@ ruleTester.run('prefer-expect-assertions (loops)', rule, {
code: dedent`
it('has the number two', () => {
expect(number).toBe(2);
})
});
it('only returns numbers that are less than twenty', () => {
for (const number of getNumbers()) {
Expand All @@ -486,7 +486,7 @@ ruleTester.run('prefer-expect-assertions (loops)', rule, {
for (const number of getNumbers()) {
expect(number).toBeGreaterThan(4);
}
})
});
`,
options: [{ onlyFunctionsWithExpectInLoop: true }],
errors: [
Expand All @@ -501,17 +501,17 @@ ruleTester.run('prefer-expect-assertions (loops)', rule, {
code: dedent`
it("is a number that is greater than four", () => {
expect(number).toBeGreaterThan(4);
})
});
it("returns numbers that are greater than four", () => {
for (const number of getNumbers()) {
expect(number).toBeGreaterThan(4);
}
})
});
it("returns numbers that are greater than five", () => {
expect(number).toBeGreaterThan(5);
})
});
`,
options: [{ onlyFunctionsWithExpectInLoop: true }],
errors: [
Expand Down Expand Up @@ -648,13 +648,13 @@ ruleTester.run('prefer-expect-assertions (loops)', rule, {
for (const number of getNumbers()) {
expect(number).toBeGreaterThan(4);
}
})
});
it("it1", () => {
for (const number of getNumbers()) {
expect(number).toBeGreaterThan(4);
}
})
});
`,
options: [{ onlyFunctionsWithExpectInLoop: true }],
errors: [
Expand All @@ -673,13 +673,13 @@ ruleTester.run('prefer-expect-assertions (loops)', rule, {
for (const number of getNumbers()) {
expect(number).toBeGreaterThan(4);
}
})
});
it("it1", () => {
for (const number of getNumbers()) {
expect(number).toBeGreaterThan(4);
}
})
});
`,
options: [{ onlyFunctionsWithExpectInLoop: true }],
errors: [
Expand All @@ -696,15 +696,15 @@ ruleTester.run('prefer-expect-assertions (loops)', rule, {
for (const number of getNumbers()) {
expect(number).toBeGreaterThan(4);
}
})
});
it("it1", () => {
expect.hasAssertions();
for (const number of getNumbers()) {
expect(number).toBeGreaterThan(4);
}
})
});
`,
options: [{ onlyFunctionsWithExpectInLoop: true }],
errors: [
Expand All @@ -728,7 +728,7 @@ ruleTester.run('prefer-expect-assertions (mixed)', rule, {
for (const number of await getNumbers()) {
expect(number).toBeGreaterThan(0);
}
})
});
`,
options: [
{
Expand All @@ -745,7 +745,7 @@ ruleTester.run('prefer-expect-assertions (mixed)', rule, {
for (const number of await getNumbers()) {
expect(number).toBeGreaterThan(0);
}
})
});
`,
options: [
{
Expand Down Expand Up @@ -830,7 +830,7 @@ ruleTester.run('prefer-expect-assertions (mixed)', rule, {
for (const number of getNumbers()) {
expect(number).toBeGreaterThan(0);
}
})
});
`,
options: [
{
Expand Down

0 comments on commit 6e5e94f

Please sign in to comment.