-
Notifications
You must be signed in to change notification settings - Fork 144
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
Async/await refactoring for tests/io folder - test.xpi.js #1742
Async/await refactoring for tests/io folder - test.xpi.js #1742
Conversation
Sorry for the hiccup and weird test breakage, #1749 just got merged and once you rebase your branch to master tests should be working fine again :) |
tests/io/test.xpi.js
Outdated
expect(err.message).toContain('open() test'); | ||
}); | ||
|
||
try { |
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.
As for #1733, we can use await expect(...).rejects.toThrow("...")
here (and for the other try/catch
from this test file).
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.
@rpl I've changed some Jest methods in this file
tests/io/test.xpi.js
Outdated
}); | ||
const readStream = await myXpi.getFileAsStream('manifest.json'); | ||
|
||
const onceReadString = new Promise((resolve, reject) => { |
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.
we should be able to reuse the readStringFromStream
test helper from #1733
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.
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.
@rpl I've made necessary changes. Please check it out.
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.
Thanks a lot @hameleonka!
This test file is now much more readable!
@EnTeQuAk This PR should now be ready for you!
Glorious, merged! 👍 |
@rpl in this PR I've worked on test.xpi.js in tests/io folder. Please check it out, waiting for your review.