-
Notifications
You must be signed in to change notification settings - Fork 70
Add support for generic file extension __mocks__ #21
Conversation
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 - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
var extensions; | ||
if(options && options.extensions){ | ||
extensions = options.extensions; | ||
}else{ |
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.
Style nit:
if (options && options.extensions) {
(space before opening paren, before opening brace, ditto for the else below)
This seems reasonable to me. @jeffmo? |
Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed. |
@zpao Any update on this? It's been 6 months and I'd be interested if there's a chance this could be merged :) |
I'm going to actually back off of this because I don't know the downstream implications. We're trying to move away from node-haste actually but not sure what the timeline is, I think jest is the only consumer we have left. Perhaps @cpojer can comment and say if this is a good thing to take. |
@zpao Well there are many open issues in Jest that are only solvable by changing node-haste right now, e.g. almost everything that has to do with |
We are about to rewrite node-haste and will launch a new version of jest with it. |
We rewrote node-haste with a new implementation. I will implement this specific feature in jest >= 0.8.x. jest 0.8.0 will be launched with the new implementation of node-haste towards the end of the year. The integration work can be tracked in jestjs/jest#599 |
sounds good |
This makes the MockLoader match files depending on the options.extensions configuration, falling back to
.js
(which was the previous behavior).Our application and jest tests are written in CoffeeScript and so we modified haste to be able to write mocks in it as well.