-
Notifications
You must be signed in to change notification settings - Fork 776
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
refactor: onload listener for stylesheets in before hook of tests #1132
Conversation
}) | ||
.catch(function(error) { | ||
console.error('Could not load stylesheets for testing.', error); | ||
done(); |
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.
Seems like this should cause the tests to fail.
}) | ||
.catch(function(error) { | ||
console.error('Could not load stylesheets for testing.', error); | ||
done(); |
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.
Same here, if injecting fails, the before hook should fail.
test/testutils.js
Outdated
promises.push(p); | ||
}); | ||
|
||
return Promise.all(promises); |
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 won't work in IE.
Usage of |
This PR refactors the
addStyleSheet
helper for CSSOM based tests intoaxe.testUtils
object. The function also returns a promise, thereby allowing to wait until the stylesheets are loaded in thebefore
hook, thus ensuring assets are available before running respective tests.Closes issue:
Reviewer checks
Required fields, to be filled out by PR reviewer(s)