summaryrefslogtreecommitdiff
path: root/test/parallel/test-util-inherits.js
AgeCommit message (Collapse)Author
2019-01-14util: fixes type in argument type validation errorAnkur Oberoi
PR-URL: https://github.com/nodejs/node/pull/25103 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-10-01util: set `super_` property to non-enumerableRuben Bridgewater
Using `util.inherits()` adds a `super_` property to the constructor and inspecting that constructor is going to show that property even though it's not useful for the user. Therefore the property is now set as non-enumerable and such entries are not visible by default when using `console.log()` or `util.inspect()`. PR-URL: https://github.com/nodejs/node/pull/23107 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-25lib,test: minor refactoringRuben Bridgewater
This refactors a couple tests to have upper case first characters in comments and to use `input` instead of `i`. It also adds a few TODOs and rewrites a few lines to use default arguments and to prevent function recreation when unnecessary. PR-URL: https://github.com/nodejs/node/pull/19445 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-03-25lib: always show ERR_INVALID_ARG_TYPE received partRuben Bridgewater
This makes a effort to make sure all of these errors will actually also show the received input. On top of that it refactors a few tests for better maintainability. It will also change the returned type to always be a simple typeof instead of special handling null. PR-URL: https://github.com/nodejs/node/pull/19445 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-01-09test: replace assert.throws with expectsErrorsreepurnajasti
PR-URL: https://github.com/nodejs/node/pull/17997 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-12-08test: replace assert.throws w/ common.expectsErrorMithun Sasidharan
PR-URL: https://github.com/nodejs/node/pull/17498 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Jon Moss <me@jonathanmoss.me>
2017-11-12lib: improve the usage of TypeError[INVALID_ARG_TYPE]Weijia Wang
The initials of expected in TypeError[ERR_INVALID_ARG_TYPE] are inconsistent. This change is to unify them. PR-URL: https://github.com/nodejs/node/pull/16401 Fixes: https://github.com/nodejs/node/issues/16383 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2017-07-27test: adjust indentation for stricter lintingRich Trott
ESLint 4.x has stricter linting than previous versions. We are currently using the legacy indentation rules in the test directory. This commit changes the indentation of files to comply with the stricter 4.x linting and enable stricter linting in the test directory. PR-URL: https://github.com/nodejs/node/pull/14431 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2017-06-22errors: improve ERR_INVALID_ARG_TYPERuben Bridgewater
The error message might be misleading if an object property was the issue and not the argument itself. Fix this by checking if a argument or a property is passed to the handler function. PR-URL: https://github.com/nodejs/node/pull/13730 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-06-02errors,util: migrate to use internal/errors.jsBidisha Pyne
PR-URL: https://github.com/nodejs/node/pull/13293 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-05-05lib,test: use regular expression literalsRich Trott
Replace RegExp constructors with regular expression literals where possible. PR-URL: https://github.com/nodejs/node/pull/12807 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-04-27test: cleanup test-util-inherits.jsRobotMermaid
Replaced constructor with regular expression for assert.throw(). PR-URL: https://github.com/nodejs/node/pull/12602 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2015-10-27util: make inherits work with classesMichaël Zasso
The current implementation overwrites the prototype of the target constructor. It is not allowed with ES2015 classes because the prototype property is read only. Use Object.setPrototypeOf instead. Fixes: https://github.com/nodejs/node/issues/3452 PR-URL: https://github.com/nodejs/node/pull/3455 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2015-10-26test: improve tests for util.inheritsMichaël Zasso
inherits is used in lib and tests but its functionality itself is not tested yet. PR-URL: https://github.com/nodejs/node/pull/3507 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>