-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: make tests strict (1) #27731
chore: make tests strict (1) #27731
Conversation
3e5f23e
to
a21f9da
Compare
This comment has been minimized.
This comment has been minimized.
@@ -562,9 +562,9 @@ it('should have popup requests', async ({ contextFactory, server }, testInfo) => | |||
await popup.waitForLoadState(); | |||
const log = await getLog(); | |||
|
|||
expect(log.pages.length).toBe(2); | |||
expect(log.pages!.length).toBe(2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we just make pages
non-nullable?
@@ -33,19 +33,19 @@ test.describe('cli codegen', () => { | |||
recorder.trustedClick(), | |||
]); | |||
|
|||
expect.soft(sources.get('JavaScript').text).toContain(` | |||
expect.soft(sources.get('JavaScript')!.text).toContain(` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just sad...
@@ -172,8 +172,8 @@ it.describe('pause', () => { | |||
const button = await page.waitForSelector('button'); | |||
const box1 = await button.boundingBox(); | |||
|
|||
const x1 = box1.x + box1.width / 2; | |||
const y1 = box1.y + box1.height / 2; | |||
const x1 = box1!.x + box1!.width / 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also painful for our users.
expect(await root2.$eval(`css=#target`, e => e.textContent)).toBe('Hello from root2'); | ||
expect(await root2.$(`css:light=#target`)).toBe(null); | ||
const root2Shadow = await root2.evaluateHandle(r => r.shadowRoot); | ||
const root2Shadow = (await root2.evaluateHandle(r => r.shadowRoot) as ElementHandle<ShadowRoot>)!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps the following will also work?
const root2Shadow = (await root2.evaluateHandle(r => r.shadowRoot) as ElementHandle<ShadowRoot>)!; | |
const root2Shadow = await root2.evaluateHandle(r => r.shadowRoot!); |
@@ -236,7 +237,7 @@ it('should work with *', async ({ page }) => { | |||
expect(await page.$$eval('div *', els => els.length)).toBe(2); | |||
expect(await page.$$eval('* > *', els => els.length)).toBe(6); | |||
|
|||
const body = await page.$('body'); | |||
const body = (await page.$('body')) as ElementHandle<HTMLBodyElement>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const body = (await page.$('body')) as ElementHandle<HTMLBodyElement>; | |
const body = (await page.$('body'))!; |
This comment has been minimized.
This comment has been minimized.
a21f9da
to
f40ff01
Compare
f40ff01
to
805993e
Compare
This comment has been minimized.
This comment has been minimized.
Test results for "tests 1"1 failed 10 flaky25935 passed, 603 skipped Merge workflow run. |
No description provided.