-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Mocha@3 support #216
base: master
Are you sure you want to change the base?
Mocha@3 support #216
Conversation
I want to update the yarn.lock (even though the README says to use npm) but I keep getting this error. Anyone know how to get around this? I don't use yarn much.
|
Likely the yarn lock accidentally checked in referring to a private registry (note the yahoo.com there). |
I’m unsure how to force yarn to use a registry that isn’t what the yarn.lock has without just blowing away the yarn.lock... |
Ahh, I see. I know it says not to at the top... but I edited yarn.lock to replace the yahoo registry entry with the one you get doing |
@a13o did you test these changes with a few projects? e.g. https://github.com/TryGhost/Ghost-Admin is a good open source project to test against |
No, I'll start testing this with other projects using ember-mocha and report back. It's gonna take me some time to get to as my upcoming weekend is already full |
I ran this branch today on a private repo with 6000+ tests across an app and an addon. I ran it on the suite both before and after we did the new testing api upgrade. Worked in all cases! Let's keep documenting successes so we can build confidence in the PR or fix any issues found |
that's good to hear, thanks @apellerano-pw! |
Tested this on Ghost-Admin, it seems to break in tests with |
I think my approach to squelching the overspecification error is wrong. It might have to go in the other direction and modify the wrapper function in the adapter to always return a promise, rather than always use a It's gonna take a bigger rewrite than I thought. My time is limited to work on this but I'll keep pushing when I can and leaving updates here. The next step is I believe I can write test cases now for what we need. I'm not sure what the long term plans are for this project; has the possibility of a major version bump and breaking change been discussed? If so I would rather yield to that than continue this approach of removing official mocha functionality in the name of backwards compatibility. Every day we stray further from mocha's light 😛 |
yeah, it had been discussed. but back then the new testing API was still very young and we decided to keep support for the old one for now. the new API has been around for some time now though, so maybe it's time to deprecate the old API. on the other hand |
Based on the discussion in #206 this PR adds support for mocha v3.5.3.
The behavior of
.only
was modified to match the new behavior added in mocha 3.Mocha 3 also introduces an overspecification exception if your test both returns a promise and uses the
done
hook. I removed this exception so overspecified tests will still work. It accomplishes this by effectively making every test async and ignoring thedone
hook.