Skip to content
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

Merged
merged 4 commits into from
Jan 24, 2018
Merged

Async/await refactoring for tests/io folder - test.xpi.js #1742

merged 4 commits into from
Jan 24, 2018

Conversation

hameleonka
Copy link
Contributor

@rpl in this PR I've worked on test.xpi.js in tests/io folder. Please check it out, waiting for your review.

@EnTeQuAk
Copy link
Contributor

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 :)

expect(err.message).toContain('open() test');
});

try {
Copy link
Member

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).

Copy link
Contributor Author

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

});
const readStream = await myXpi.getFileAsStream('manifest.json');

const onceReadString = new Promise((resolve, reject) => {
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rpl I can't make this change until #1733 is merged (because there I included readStringFromStream into helpers)

Copy link
Contributor Author

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.

Copy link
Member

@rpl rpl left a 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!

@EnTeQuAk EnTeQuAk merged commit dfd9bb9 into mozilla:master Jan 24, 2018
@EnTeQuAk
Copy link
Contributor

Glorious, merged! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants