Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Add support for generic file extension __mocks__ #21

Closed
wants to merge 2 commits into from

Conversation

johannhof
Copy link

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.

@facebook-github-bot
Copy link

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!

@facebook-github-bot
Copy link

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{
Copy link

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)

@zpao
Copy link

zpao commented Feb 27, 2015

This seems reasonable to me. @jeffmo?

@johannhof
Copy link
Author

@zpao Sorry, didn't catch your reply. Style should be fixed now. Thanks!

@jeffmo I'd love to get an opinion :)

@ghost
Copy link

ghost commented Aug 4, 2015

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.

@johannhof
Copy link
Author

@zpao Any update on this? It's been 6 months and I'd be interested if there's a chance this could be merged :)

@zpao
Copy link

zpao commented Sep 12, 2015

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.

@johannhof
Copy link
Author

@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 __mocks__. If you want to enable development/contributions your team should make a decision on haste. I would welcome getting rid of it but that sounds pretty long-term.

@cpojer
Copy link

cpojer commented Oct 28, 2015

We are about to rewrite node-haste and will launch a new version of jest with it.

@cpojer
Copy link

cpojer commented Nov 16, 2015

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

@cpojer cpojer closed this Nov 16, 2015
@johannhof
Copy link
Author

sounds good

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants