-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
jshint error for 'describe/it not defined' on generated helper tests #37
Comments
👍 Would appreciate the correct path to import 'describe' from. The generators here don't specify one. |
I just added describe & it inside _tests/.jshintrc_ and it seems to have solved it for now. tests/.jshintrc {
⋮
"predef": [
⋮
"describe",
"it"
⋮
],
⋮
} |
Ember-cli 0.1.13 update is trying to move away from any global like this: http://reefpoints.dockyard.com/2015/02/06/ember-qunit-0-2.html https://github.com/ember-cli/ember-cli/releases/tag/v0.1.13 |
I think this should be handled up stream, and created an issue in ember-mocha for it: emberjs/ember-mocha#22 |
@rwjblue good call, thanks for raising. Is it worth raising about exposing |
Not sure, I'm not a heavy ember-mocha user, I was mostly trying to help point @dgeb and others towards a possible solution (that we pulled into ember-qunit). |
Thanks @rwjblue @jonathanKingston @DisruptiveMind et al - PRs welcome over in ember-mocha as spec'd out in emberjs/ember-mocha#22
Seems like an additional top-level |
@dgeb I'll make a PR for the describe at some point soonish unless someone else gets to it first. I made a quick chai package to expose the main interfaces to chai. This might be a better fragmentation from just having ember-cli module define the use of Chai too: https://github.com/jonathanKingston/ember-cli-chai |
Submitted emberjs/ember-mocha#23 to add the shims, this repo will still need to be updated (mostly blueprints I think) once that lands. |
I've just added the import statements for the helpers blueprint in DisruptiveMind/ember-cli-mocha@afe5711. I'm holding off the PR for now. Just wondering, should |
@DisruptiveMind I was thinking about this the other day, would it make more sense to have ember-cli-mocha more configurable so that any assertion library can be used. The addon could take a config argument for example, which would then modify the helpers accordingly. So something like:
Would generate:
This might be something that can be made generic enough to be usable from ember-cli-qunit too. What do you think @rwjblue. |
@jonathanKingston 👍 on configurable options |
Please upgrade to ember-cli-mocha 0.5.0 and then run ember-mocha now exports shimmed mocha and chai modules. Note that only I've also updated the blueprints to use these new shims. I like the idea in theory of making these blueprints more flexible as you've described above, as long as we can do so without too much noise in the blueprints. If you want to pursue an approach, please open a new issue / PR. |
@dgeb 👍 Does doing the following with 'should' not work as expected:
As far as I was aware exporting the should method then using this within a module scope should have a self contained impact. |
@jonathanKingston - I am not an expert on chai but it seems that |
But I do agree that the |
@rwjblue yeah it does, I guess I just assumed ES6 modules completely isolated their code even for native prototypes (It hasn't been something I had tried before because of it's edge usecase - however would certainly help if that was the expected behaviour and Babel just needed to implement). |
@jonathanKingston - I'm pretty sure that ES6 does not suggest that modifications to core prototypes are isolated within each module (and if it did, I highly doubt that it could be polyfilled via babel). |
Yeah, once |
This is exactly why I left it out of my initial |
And, I still haven't heard anyone say they wanted to use |
@rwjblue yes I am advocating for it to be pluggable (I was just trying to ascertain if it would be isolated). From my quick scrambling through the ES6 spec (I'm probably not reading this right).
So no help there, however I believe that is just describing normal behaviour of scripts.
My reading of that is I could be wrong in how that is supposed to be read, however if that is the case Babel could be updated with this behaviour. |
Also:
So I will double check this issue exists in Babel, if it does then hopefully that can be fixed there to isolate the prototypes. |
When generating a new helper the associated test does not run due to globals
'describe'
and'it'
not being defined.Generated
Results in:
solution....sort of
I manually added
'describe'
and'it'
to _tests/.jshintrc_ after looking at #3Is there another way of doing this or am I hooking things up wrong somewhere else?
The text was updated successfully, but these errors were encountered: