Skip to content

Commit c9de185

Browse files
author
Mark Skelton
authored
Add tests for expect.soft (playwright-community#37)
1 parent e3b0f98 commit c9de185

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/missing-playwright-await.spec.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ new RuleTester().run("missing-playwright-await", rule, {
5050
options
5151
),
5252

53+
// expect.soft
54+
invalid(
55+
"expect",
56+
"expect.soft(page).toBeChecked()",
57+
"await expect.soft(page).toBeChecked()"
58+
),
59+
invalid(
60+
"expect",
61+
"expect.soft(page).toBeChecked()",
62+
"await expect.soft(page).toBeChecked()"
63+
),
64+
5365
// test.step
5466
invalid(
5567
"testStep",
@@ -75,6 +87,10 @@ new RuleTester().run("missing-playwright-await", rule, {
7587
valid("await expect(page).toBeCustomThing(true)"),
7688
valid("expect(page).toBeCustomThing(true)"),
7789

90+
// expect.soft
91+
valid('await expect.soft(page).toHaveText("text")'),
92+
valid('await expect.soft(page).not.toHaveText("text")'),
93+
7894
// test.step
7995
valid("await test.step('foo', async () => {})"),
8096
],

0 commit comments

Comments
 (0)