-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Support default exports for runners #10826
Conversation
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.
👍
could you add a changelog entry?
@@ -193,7 +193,8 @@ export default class TestScheduler { | |||
contexts.forEach(context => { | |||
const {config} = context; | |||
if (!testRunners[config.runner]) { | |||
const Runner: typeof TestRunner = require(config.runner); | |||
const Runner: typeof TestRunner = | |||
require(config.runner).default || require(config.runner); |
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.
Ah ok cool. Later on I'll try to make use of this and add a changelog entry.
Actually, this will be covered by #8854 👍 Thanks for sending a PR tho 😀 |
@SimenB ok cool - but that PR hasn't been touched in over a year. So should we merge this instead? |
I believe that is only because of the breaking change. A rebase is probably all it needs to go into 27. Correct me if I'm wrong tho @SimenB |
yep, backed out of 26 to allow it to be non-breaking |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
When writing a new runner recently I noticed I couldn't use some TypeScript/bundler configurations because Jest was never looking for default exports. This is a small change which will allow for that.
Test plan
Tests pass locally apart from some irrelevant snapshot tests and hg tests.