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
test: fix workers test #3527
test: fix workers test #3527
Conversation
test/worker.spec.js
Outdated
@@ -15,7 +15,7 @@ module.exports.addTests = function({testRunner, expect}) { | |||
expect(await worker.evaluate(() => self.workerFunction())).toBe('worker function result'); | |||
|
|||
await page.goto(server.EMPTY_PAGE); | |||
expect(page.workers()).toEqual([]); | |||
expect(page.workers().length).toBe(1); |
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 doesn't make sense to me. Isn't it the opposite of what the test is testing for? EMPTY_PAGE shouldn't have any workers.
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.
Ah, I meant 0.
@@ -15,7 +15,7 @@ module.exports.addTests = function({testRunner, expect}) { | |||
expect(await worker.evaluate(() => self.workerFunction())).toBe('worker function result'); | |||
|
|||
await page.goto(server.EMPTY_PAGE); | |||
expect(page.workers()).toEqual([]); | |||
expect(page.workers().length).toBe(0); |
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.
I don't get it. Whats the change?
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.
when this test fails, the output is cryptic since Worker object is not nicely serializable.
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.
Fair
No description provided.