-
Notifications
You must be signed in to change notification settings - Fork 19
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
JsMockito with NodeJS #7
Comments
There is no particular roadmap. It's pretty usable as is, but enhancement's I'm not sure exactly what this patch you've sent does: the diff isn't overly cheers, On 20 September 2011 00:00, Neuman Vong <
|
chris, i just spent some time getting jsmockito plugged into nodejs, specifically into a vows test, and i now understand what luciferous did, at least with the exports. Both JSMockito and JSHamcrest have support for copying public functions into a target context, but the issue is that they don't export anything by default. In Node, you use require() to get access to another module. The object returned by require is effective the public API for the module you required. That object can get it's members in a number of different ways, but the basic issue is that it has to have something. Given that JSMockito don't export anything by default, you can't get a handle to anything that would allow you to run the import JSMockito.Integration.importTo() function. So to work with Node JSMockito has to export something, thus the addition of the line: JsMockito.Integration.importTo( exports ); Does this help? |
Hi Chris, great work with JsMockito. I'm using it in a browser and NodeJS environment. It's unclear to me if there is a roadmap for getting JsMockito to work with NodeJS, but I thought I'd contribute my half-solution so other people looking to do the same may build on top of it.
The details are in https://gist.github.com/1227705.
The text was updated successfully, but these errors were encountered: