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

normalize setters and getters #3058

Closed
boneskull opened this issue Oct 6, 2017 · 0 comments · Fixed by #3064
Closed

normalize setters and getters #3058

boneskull opened this issue Oct 6, 2017 · 0 comments · Fixed by #3064
Labels
semver-minor implementation requires increase of "minor" version number; "features" status: accepting prs Mocha can use your help with this one! type: chore generally involving deps, tooling, configuration, etc.

Comments

@boneskull
Copy link
Member

The main classes (Runnable, Test, Context, Suite, Mocha, etc.) have these setter/getter functions, e.g. Runnable#timeout(). Not all of these, however, implement the "getter" part, where it's supposed to just return the value if it receives no arguments.

Furthermore, there are some methods that might check if the first argument is undefined; they need to check length of arguments instead, because undefined or void 0 is a valid argument.

@boneskull boneskull added type: chore generally involving deps, tooling, configuration, etc. status: accepting prs Mocha can use your help with this one! semver-minor implementation requires increase of "minor" version number; "features" labels Oct 6, 2017
makepanic added a commit to makepanic/mocha that referenced this issue Oct 9, 2017
makepanic added a commit to makepanic/mocha that referenced this issue Oct 9, 2017
makepanic added a commit to makepanic/mocha that referenced this issue Oct 16, 2017
makepanic added a commit to makepanic/mocha that referenced this issue Oct 18, 2017
OmgImAlexis pushed a commit to agenda/agenda that referenced this issue Jun 26, 2018
This Pull Request updates dependency [mocha](https://github.com/mochajs/mocha) from `v4.0.1` to `v4.1.0`



<details>
<summary>Release Notes</summary>

### [`v4.1.0`](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md#&#8203;410--2017-12-28)
[Compare Source](mochajs/mocha@v4.0.1...v4.1.0)
This is mainly a "housekeeping" release.

Welcome [@&#8203;Bamieh] and [@&#8203;xxczaki] to the team!
#### 🐛 Fixes

- [#&#8203;2661]: `progress` reporter now accepts reporter options ([@&#8203;canoztokmak])
- [#&#8203;3142]: `xit` in `bdd` interface now properly returns its `Test` object ([@&#8203;Bamieh])
- [#&#8203;3075]: Diffs now computed eagerly to avoid misinformation when reported ([@&#8203;abrady0])
- [#&#8203;2745]: `--help` will now help you even if you have a `mocha.opts` ([@&#8203;Zarel])
#### 🎉 Enhancements

- [#&#8203;2514]: The `--no-diff` flag will completely disable diff output ([@&#8203;CapacitorSet])
- [#&#8203;3058]: All "setters" in Mocha's API are now also "getters" if called without arguments ([@&#8203;makepanic])
#### 📖 Documentation

- [#&#8203;3170]: Optimization and site speed improvements ([@&#8203;Munter])
- [#&#8203;2987]: Moved the old [site repo](https://github.com/mochajs/mochajs.github.io) into the main repo under `docs/` ([@&#8203;boneskull])
- [#&#8203;2896]: Add [maintainer guide](https://github.com/mochajs/mocha/blob/master/MAINTAINERS.md) ([@&#8203;boneskull])
- Various fixes and updates ([@&#8203;xxczaki], [@&#8203;maty21], [@&#8203;leedm777])
#### 🔩 Other

- Test improvements and fixes ([@&#8203;eugenet8k], [@&#8203;ngeor], [@&#8203;38elements], [@&#8203;Gerhut], [@&#8203;ScottFreeCode], [@&#8203;boneskull])
- Refactoring and cruft excision ([@&#8203;38elements], [@&#8203;Bamieh], [@&#8203;finnigantime], [@&#8203;boneskull])

[#&#8203;2661]: `mochajs/mocha#2661
[#&#8203;3142]: `mochajs/mocha#3142
[#&#8203;3075]: `mochajs/mocha#3075
[#&#8203;2745]: `mochajs/mocha#2745
[#&#8203;2514]: `mochajs/mocha#2514
[#&#8203;3058]: `mochajs/mocha#3058
[#&#8203;3170]: `mochajs/mocha#3170
[#&#8203;2987]: `mochajs/mocha#2987
[#&#8203;2896]: `mochajs/mocha#2896
[@&#8203;canoztokmak]: https://github.com/canoztokmak
[@&#8203;Bamieh]: https://github.com/Bamieh
[@&#8203;abrady0]: https://github.com/abrady0
[@&#8203;Zarel]: https://github.com/Zarel
[@&#8203;CapacitorSet]: https://github.com/CapacitorSet
[@&#8203;xxczaki]: https://github.com/xxczaki
[@&#8203;maty21]: https://github.com/maty21
[@&#8203;leedm777]: https://github.com/leedm777
[@&#8203;eugenet8k]: https://github.com/eugenet8k
[@&#8203;38elements]: https://github.com/38elements
[@&#8203;Gerhut]: https://github.com/Gerhut
[@&#8203;finnigantime]: https://github.com/finnigantime

---

</details>




---

This PR has been generated by [Renovate Bot](https://renovatebot.com).
sgilroy pushed a commit to TwineHealth/mocha that referenced this issue Feb 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-minor implementation requires increase of "minor" version number; "features" status: accepting prs Mocha can use your help with this one! type: chore generally involving deps, tooling, configuration, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant