fix: make it().timeout() work again#4599
fix: make it().timeout() work again#4599juergba merged 3 commits intomochajs:masterfrom alexander-fenster:it-timeout
Conversation
giltayar
left a comment
There was a problem hiding this comment.
LGTM. We should have thought to proxy the return value too in the PR that provoked this fix...
No sorry, I'm wrong. But then your test doesn't prove that your fix is working, @alexander-fenster. |
|
@juergba Oops, you're right. I updated the test fixture to do |
juergba
left a comment
There was a problem hiding this comment.
@alexander-fenster thanks for this PR.
I would prefer putting the tests to a different location.
We already have some tests for our require interface (from #4574):
- test/integration/common-js-require.spec.js
- test/integration/fixtures/common-js-require.fixture.js
Please just append a timeout and retries test to our existing tests. Thank you.
|
@juergba Done, please take a look. |
juergba
left a comment
There was a problem hiding this comment.
@alexander-fenster thank you.
The cancelled browser test is off-topic.
Requirements
Description of the Change
Fixes #4598. The code change in #4574 had a breaking change: constructs like
it(...).timeout(...),it(...).retries(...), etc. stopped working.Replacing
exports.it = context.it || context.test;withchanges the return value of
it()toundefined, thus introducing a breaking change in the patch release.This PR brings this functionality back, and adds an integration test.
Alternate Designs
None. This is a breaking change in a patch release. The behavior, albeit undocumented officially, is widely used (see this StackOverflow answer, for example).
Why should this be in core?
Just bringing back the old behavior.
Benefits
No breaking change :)
Possible Drawbacks
None that I'm aware of.
Applicable issues
#4598