-
-
Notifications
You must be signed in to change notification settings - Fork 768
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
Convert matcher tests to mocha #1004
Conversation
I'm pretty much all for it. This is how I test stuff at work as well. Really I'm less concerned with what tools are being used and more about it being nice and easy to run and write tests. This approach makes it nice and easy to run and write tests. |
👍 |
@jonnyreeves We might have some overlap here. I'm currently going through |
Happy to pause whilst we move to mocha! I have a sneaky feeling this will avoid any potential issues with buster placing its own copy of sinon on the window. |
Great. If nothing surprising happens, this is done relatively quick. |
Status update:
Outstanding:
|
Most excellent |
THE BUILD IS GREEN!I managed to put a webworker test together and configured the SauceLabs build. The tests are passing in Node 0.12, 4.3 and 5, PhantomJS 2, IE 10 (with a fix), IE 11 and Firefox. Chrome seems to suffer from the same problem as the Lolex build. I can reproduce this with a local Selenium / chromedriver setup and will look into this another time. I’ve put everything into npm scripts. The Still missing:
From my point of view this is good to merge. The open points can be addressed later. Thoughts? |
Nice work @mantoni! :)
We would need a new set of tests which only try to pick up from the |
@@ -1,19 +1,20 @@ | |||
/*eslint-env mocha*/ |
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.
Maybe just add this rule to the test/.eslintrc
file?
We should probably add https://github.com/lo1tuma/eslint-plugin-mocha to the configuration, so that we won't accidentally merge a commit that disables most tests |
@jonnyreeves Yes, I also think that we should have a separate set of integration tests for the bundled file. At least some sort of sanity check that verifies that all the API function are there and don't throw. |
Also, |
Convert matcher tests to mocha
So, on the chrome front, I think we're not the only ones with the issue: There is also a corresponding issue in Mochify to track the issue on the test runner side. The good news is that the test suite passes fine in Chrome if you run
|
This is amazing. @mantoni You're a saint. Since I see a lot of you referencing the export PATH="./node_modules/.bin:$PATH" If you add that to your |
I just tried converting the matcher tests to Mocha. It turns out to be straight forward. In cases where the
requiresSupportFor
is used, it would needif
statements around thedescribe
blocks.Before I walk down any rabbit holes and convert the world, I wanted to get feedback on this. We touched on the idea in previous discussions but never concluded to do this. The motivation is to have the same simple npm scripts as in lolex. We can then also run the tests in real browsers easily.
When you check out this branch, you can run the matcher tests on Node and in PhantomJS like this:
This needs some thoughts for tests that do real XHR calls. I also don't know yet how this is going to work with the webworker tests.
What are your thoughts? What is problematic or what do we loose in exchange?
Especially @cjohansen, since Buster is your thing and you know the trade offs best.