-
-
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
[WIP] Adds state and run exports to index #8748
Conversation
cc @SimenB |
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
@scotthovestadt @aaronabramov does this match the abstraction we're going for? |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
1 similar comment
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
@kvendrik Can you provide a little more information about the use-case? I don't think we want to expose those to the average consumer of the package (the API might change), but I agree internal exports could be improved within Jest. |
@scotthovestadt the use-case is one where jest-circus is used to create a minimal Jest test runner from scratch. When creating a test runner from scratch these methods are essential but it all depends on what the team's goal is for the package. If the package is strictly supposed be compatible with the Jest's |
It was, at least initially, meant to be a relatively generic test runner. It was designed to eventually work in a browser setting |
Gotcha if that's still the case I feel like having |
eecdd8f
to
d6fa868
Compare
Codecov Report
@@ Coverage Diff @@
## master #8748 +/- ##
==========================================
+ Coverage 64.12% 64.16% +0.04%
==========================================
Files 275 275
Lines 11629 11629
Branches 2846 2846
==========================================
+ Hits 7457 7462 +5
+ Misses 3545 3540 -5
Partials 627 627
Continue to review full report at Codecov.
|
Right now, the exports here are the globals jest injects, and nothing about the runner itself. This is by design, as the thought is that (eventually) you can do We have a runner file, which is meant to be given to |
@SimenB that makes a lot of sense. So import would be: import {run, addEventHandler} from 'jest-circus/runner'; Is that correct? I feel like that might make sense if we don't want it to be top level but still easily accessible. So the definition would be:
|
Yeah, exactly |
@SimenB considering |
Works for me. We need to create a |
@SimenB hows something like this https://github.com/facebook/jest/pull/8748/files Only thing now is that those files aren't always available which breaks the type check. Did you have any thoughts on how you wanted to work around that? |
Ignore the file via the |
Updated it to somewhat where we're hoping to get to. This will need some further looking into and testing so I'll add a [WIP] prefix to the title for now. P.s. if anyone needs this sooner rather than later, feel free to pick it up. |
This is probably unblocked by us adding |
@kvendrik would you be able to refresh this? I think it's something we still want to do |
This PR is stale because it has been open 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
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
Currently when you want to write a minimal
jest-circus
implementation you have to reach into thebuild/
folder to be able to get all the tools you need. @SimenB and I discussed having these essential tools available through from the top level.Test plan
I don't see any tests for the exports and figure that if this messes up other exports existing tests will fail. If you'd like me to add tests to this somehow let me know, I'd be happy to do so.