Skip to content
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

Fix patching of the test framework's 'it' function in test suites spanning multiple files #205

Merged
merged 1 commit into from
Aug 17, 2015

Conversation

papandreou
Copy link
Member

As reported by @alexjeffburke and discussed on the gitter channel.

The fix should only affect multi-file mocha suites, and I've tested that the test framework patch still does the correct thing with make test-jasmine, and make test-browser in Chrome.

@papandreou
Copy link
Member Author

We can't really do much about the coverage level, except for adding a separate (and probably very volatile) mock environment for testing it.

@sunesimonsen
Copy link
Member

LGTM

sunesimonsen added a commit that referenced this pull request Aug 17, 2015
…tiFileSuite

Fix patching of the test framework's 'it' function in test suites spanning multiple files
@sunesimonsen sunesimonsen merged commit a49d0b8 into master Aug 17, 2015
@alexjeffburke
Copy link
Member

Hi, I've been away for the last couple of days so can't yet check this. But my quick 2 øre: I know this is a little dirty and it's probably a tricky thing to maintain, but it is very useful. So if the result with patch is as simple as you get an exception that something is likely missing from your test (i.e. that blasted return) it's fantastic because it is SO easy to do. Will give master a go next chance I get. AJB

@papandreou papandreou deleted the fix/testFrameworkPatchInMultiFileSuite branch August 17, 2015 21:35
@papandreou
Copy link
Member Author

@alexjeffburke It's out in 9.5.2 now.

@alexjeffburke
Copy link
Member

The fix here has worked great - you now receive "Error: When using asynchronous assertions you must return a promise from the it block". Clearly indicates something is missing, and by the time you've fixed that you'll be back to dealing with the result of your actual test cases. Footgun disarmed :)

papandreou added a commit that referenced this pull request Oct 14, 2015
…s is retrieved from require's cache.

Fixes the scenario described in #205 when there's an unexpected-with-plugins.js or similar construct involved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants