-
Notifications
You must be signed in to change notification settings - Fork 70
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
Test require("dustjs-helpers") clobbers global dust object in node #73
Conversation
lgtm |
see comment in #72 👎 |
I think this change still applies. I'm not changing what this code does, just making what is going on here more visible. Currently spec runner for node relies on dust being a global variable. Global If we wanted to change this it, we would update old and new test runners for node
Is this approach better than what we have? To me it seems more complicated and harder to follow. |
I see. got confused with the solutions from #72. sorry for the 👎 . This makes sense. |
Do we use this for browser testing as well? we'll run into an issue with window vs global |
Yup, we use both |
Updated the diff. |
dust.helpers[key] = helpers[key]; | ||
} | ||
|
||
if(typeof module !== 'undefined') { |
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.
should we check module or exports here?
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.
We should. Updated.
looks good otherwise. |
…dInAttic#64 'Use iteration to populate dust.helpers'
…re('dustjs-helpers')
Is there any chance of this getting merged? Issue #72 is breaking a lot of code (namely, several examples of various dust-helpers) and I find the following particularly ugly:
Thank you |
Still looks good. Do you think this should be a patch, minor, or major release? I was thinking minor, but can you think of anything backwards incompatible? |
I think minor bump is appropriate here since we've bumped up dust core from 2.3 to 2.4 This change is backward compatible with previous versions. |
Extend the dust.helpers object instead of clobbering.
Updated test spec runner for node to test that
require("dustjs-helpers")
adds helpers intoglobal.dust
object. #72 has the context for this change