-
-
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
[Feature] Option to pass --require
#2205
Comments
Jest has a |
Thanks, I had overlooked it. FWIW, they have different semantics as well (doesn't follow node's require algorithm, need to manually specify the file inside the module relatively which can break if |
Nowadays Jest supports |
I'd love to make sure The problem with supporting the normal What would be needed? If we add a new |
Hi @SimenB! Thanks! Jest support is a priority for me too.
Jest's mock loader has a couple issues, but
A lot has changed in The
Is @blakeembrey's comment still correct? |
I'd be happy to work on this if we could figure out what |
@SimenB Okay! I'll report back. |
@SimenB Don't know what is changed, but jest 22 freezes after start. jest 21 works fine. |
Has there been any progress here/could it be re-opened to track necessary work? I just transitioned from mocha and {
"transform": {
".*": "<rootDir>/source-map-support-jest.js"
}
} require('source-map-support/register')
module.exports = {
process(file) {
return file
}
}
|
I am trying to wire up
This argument appears to match Node's require flag. I am trying to replicate this behavior in Jest and I am coming up short. Just wanted to present a use-case for |
Jest does not support running with |
Following that guide while debugging a Typescript file (ie |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Do you want to request a feature or report a bug? Feature
What is the current behavior? Does not exist.
What is the expected behavior?
It would be nice to have the possibility to pass through
--require
or-r
, which is available in node.js and mocha. It would just do a directrequire()
of the content from the current working directory. This flag is regularly used for setup related things, such as-r longjohn -r source-map-support/register
, and can also be used for test environment set up.The only previous mention I've seen of this in jest is #1460, but it didn't touch on the feature itself at all.
The text was updated successfully, but these errors were encountered: