Skip to content

Commit

Permalink
fix: improve test coverage for the expect-expect
Browse files Browse the repository at this point in the history
  • Loading branch information
codejedi365 committed Oct 23, 2021
1 parent 2926638 commit dfe28cc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/lib/rules/expect-expect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ describe("ESLint Code Snippets", () => {
})`,
// More than 1 function on t
`test("foo", async t => {
await t.click(button)
await t.expect(foo).eql(bar)
await t.click(button);
await t.expect(foo).eql("bar", "failed to equal bar");
})`,
// Multiple expects
`test("foo", async t => {
await t.click(button)
await t.expect(foo).eql(bar)
await t.expect(true).ok()
await t.expect(foo).eql("bar", "failed to equal bar");
})`,
// chained function with callback parameter
`test.before(async t => {
Expand All @@ -73,14 +73,18 @@ describe("ESLint Code Snippets", () => {
// Multiple tests
`fixture("My Fixture")
.page("https://example.com");
test("test1", async t => {
await t.useRole(adminRole);
await t.expect(foo).eql(bar);
});
test("test2", async t => {
await t.click(button);
await t.expect(foo).eql(bar);
});`,
// Futuristic TestCafe || unexpected test chain => ignore as valid
`test.futureModifier("test", async t => {
await t.expect(true).ok();
});`
],
invalid: [
Expand Down

0 comments on commit dfe28cc

Please sign in to comment.