<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/node-new.git/test/parallel/test-assert.js, branch test</title>
<subtitle>github.com: nodejs/node.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/'/>
<entry>
<title>test: prepare for consistent comma-dangle lint rule</title>
<updated>2021-04-02T06:14:29+00:00</updated>
<author>
<name>Rich Trott</name>
<email>rtrott@gmail.com</email>
</author>
<published>2021-03-26T15:51:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=330f25ef822dac6ed8a0afb3422bd920726eb43d'/>
<id>330f25ef822dac6ed8a0afb3422bd920726eb43d</id>
<content type='text'>
Make changes so that tests will pass when the comma-dangle settings
applied to the rest of the code base are also applied to tests.

PR-URL: https://github.com/nodejs/node/pull/37930
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Derek Lewis &lt;DerekNonGeneric@inf.is&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make changes so that tests will pass when the comma-dangle settings
applied to the rest of the code base are also applied to tests.

PR-URL: https://github.com/nodejs/node/pull/37930
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Derek Lewis &lt;DerekNonGeneric@inf.is&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tools: upgrade to @babel/eslint-parser 7.12.1</title>
<updated>2020-12-07T18:05:29+00:00</updated>
<author>
<name>Antoine du Hamel</name>
<email>duhamelantoine1995@gmail.com</email>
</author>
<published>2020-11-29T22:27:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=5f1bf80b5e0f33040f108b7bc83e2e72e425727f'/>
<id>5f1bf80b5e0f33040f108b7bc83e2e72e425727f</id>
<content type='text'>
PR-URL: https://github.com/nodejs/node/pull/36321
Fixes: https://github.com/ensure
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PR-URL: https://github.com/nodejs/node/pull/36321
Fixes: https://github.com/ensure
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>assert: align character indicators properly</title>
<updated>2020-02-09T12:39:54+00:00</updated>
<author>
<name>Ruben Bridgewater</name>
<email>ruben@bridgewater.de</email>
</author>
<published>2020-01-20T19:44:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=36f328e21fe19f9767e1bc04481bdd921ab49615'/>
<id>36f328e21fe19f9767e1bc04481bdd921ab49615</id>
<content type='text'>
This makes sure color codes are not taken into account in case
util.inspect's default value was changed.

PR-URL: https://github.com/nodejs/node/pull/31429
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes sure color codes are not taken into account in case
util.inspect's default value was changed.

PR-URL: https://github.com/nodejs/node/pull/31429
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test: improve logged errors</title>
<updated>2020-02-09T12:36:39+00:00</updated>
<author>
<name>Ruben Bridgewater</name>
<email>ruben@bridgewater.de</email>
</author>
<published>2020-01-20T18:00:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=1450ea7bf608a54640863e5ba23c6f0ce430e14f'/>
<id>1450ea7bf608a54640863e5ba23c6f0ce430e14f</id>
<content type='text'>
To indicate which lines are test lines and which from Node.js core,
it's good to rely on `util.inspect()` while inspecting errors.

The stack was accessed directly instead in multiple cases and logging
that does not provide as much information as using `util.inspect()`.

PR-URL: https://github.com/nodejs/node/pull/31425
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
Reviewed-By: Anto Aravinth &lt;anto.aravinth.cse@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Yihong Wang &lt;yh.wang@ibm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To indicate which lines are test lines and which from Node.js core,
it's good to rely on `util.inspect()` while inspecting errors.

The stack was accessed directly instead in multiple cases and logging
that does not provide as much information as using `util.inspect()`.

PR-URL: https://github.com/nodejs/node/pull/31425
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
Reviewed-By: Anto Aravinth &lt;anto.aravinth.cse@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Yihong Wang &lt;yh.wang@ibm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>assert: implement `assert.match()` and `assert.doesNotMatch()`</title>
<updated>2020-01-01T17:44:31+00:00</updated>
<author>
<name>Ruben Bridgewater</name>
<email>ruben@bridgewater.de</email>
</author>
<published>2019-12-12T21:51:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=e33f773d4f3fe24eb1210dfb09117b607c6c5d6f'/>
<id>e33f773d4f3fe24eb1210dfb09117b607c6c5d6f</id>
<content type='text'>
This adds a new functionality to the assertion module: a dedicated
check for regular expressions. So far it's possible to use
`assert.ok(regexp.test(string))`. This is not ideal though when it
comes to the error message, since it's not possible to know how
either of the input values look like. It's just known that the
assertion failed.
This allows to pass through the regular expression and the input
string. The string is then matched against the regular expression
and reports a expressive error message in case of a failure.

PR-URL: https://github.com/nodejs/node/pull/30929
Reviewed-By: Michaël Zasso &lt;targos@protonmail.com&gt;
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
Reviewed-By: Stephen Belanger &lt;admin@stephenbelanger.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds a new functionality to the assertion module: a dedicated
check for regular expressions. So far it's possible to use
`assert.ok(regexp.test(string))`. This is not ideal though when it
comes to the error message, since it's not possible to know how
either of the input values look like. It's just known that the
assertion failed.
This allows to pass through the regular expression and the input
string. The string is then matched against the regular expression
and reports a expressive error message in case of a failure.

PR-URL: https://github.com/nodejs/node/pull/30929
Reviewed-By: Michaël Zasso &lt;targos@protonmail.com&gt;
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
Reviewed-By: Stephen Belanger &lt;admin@stephenbelanger.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test: refactor common.expectsError</title>
<updated>2019-12-31T14:54:20+00:00</updated>
<author>
<name>Ruben Bridgewater</name>
<email>ruben@bridgewater.de</email>
</author>
<published>2019-12-25T17:02:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=e038d6a1cdb2ffbf666d360553c31786acaf70b2'/>
<id>e038d6a1cdb2ffbf666d360553c31786acaf70b2</id>
<content type='text'>
This completely refactors the `expectsError` behavior: so far it's
almost identical to `assert.throws(fn, object)` in case it was used
with a function as first argument. It had a magical property check
that allowed to verify a functions `type` in case `type` was passed
used in the validation object. This pattern is now completely removed
and `assert.throws()` should be used instead.

The main intent for `common.expectsError()` is to verify error cases
for callback based APIs. This is now more flexible by accepting all
validation possibilites that `assert.throws()` accepts as well. No
magical properties exist anymore. This reduces surprising behavior
for developers who are not used to the Node.js core code base.

This has the side effect that `common` is used significantly less
frequent.

PR-URL: https://github.com/nodejs/node/pull/31092
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Trivikram Kamat &lt;trivikr.dev@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This completely refactors the `expectsError` behavior: so far it's
almost identical to `assert.throws(fn, object)` in case it was used
with a function as first argument. It had a magical property check
that allowed to verify a functions `type` in case `type` was passed
used in the validation object. This pattern is now completely removed
and `assert.throws()` should be used instead.

The main intent for `common.expectsError()` is to verify error cases
for callback based APIs. This is now more flexible by accepting all
validation possibilites that `assert.throws()` accepts as well. No
magical properties exist anymore. This reduces surprising behavior
for developers who are not used to the Node.js core code base.

This has the side effect that `common` is used significantly less
frequent.

PR-URL: https://github.com/nodejs/node/pull/31092
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Trivikram Kamat &lt;trivikr.dev@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>errors: improve ERR_INVALID_ARG_TYPE</title>
<updated>2019-12-20T02:10:13+00:00</updated>
<author>
<name>Ruben Bridgewater</name>
<email>ruben@bridgewater.de</email>
</author>
<published>2019-09-23T06:17:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=ac2fc0dd5f5830d32dd89fe1c9c55d672cf59c0a'/>
<id>ac2fc0dd5f5830d32dd89fe1c9c55d672cf59c0a</id>
<content type='text'>
ERR_INVALID_ARG_TYPE is the most common error used throughout the
code base. This improves the error message by providing more details
to the user and by indicating more precisely which values are allowed
ones and which ones are not.

It adds the actual input to the error message in case it's a primitive.
If it's a class instance, it'll print the class name instead of
"object" and "falsy" or similar entries are not named "type" anymore.

PR-URL: https://github.com/nodejs/node/pull/29675
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ERR_INVALID_ARG_TYPE is the most common error used throughout the
code base. This improves the error message by providing more details
to the user and by indicating more precisely which values are allowed
ones and which ones are not.

It adds the actual input to the error message in case it's a primitive.
If it's a class instance, it'll print the class name instead of
"object" and "falsy" or similar entries are not named "type" anymore.

PR-URL: https://github.com/nodejs/node/pull/29675
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>assert: handle (deep) equal(NaN, NaN) as being identical</title>
<updated>2019-12-06T23:43:51+00:00</updated>
<author>
<name>Ruben Bridgewater</name>
<email>ruben@bridgewater.de</email>
</author>
<published>2019-12-02T12:12:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=5360dd151da9d8b1c97785a0e394cc731af31f69'/>
<id>5360dd151da9d8b1c97785a0e394cc731af31f69</id>
<content type='text'>
This aligns the `equal` and `deepEqual()` implementations with the
strict versions by accepting `NaN` as being identical in case both
sides are NaN.

Refs: https://github.com/nodejs/node/issues/30350#issuecomment-552191641

PR-URL: https://github.com/nodejs/node/pull/30766
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Denys Otrishko &lt;shishugi@gmail.com&gt;
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: David Carlier &lt;devnexen@gmail.com&gt;
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This aligns the `equal` and `deepEqual()` implementations with the
strict versions by accepting `NaN` as being identical in case both
sides are NaN.

Refs: https://github.com/nodejs/node/issues/30350#issuecomment-552191641

PR-URL: https://github.com/nodejs/node/pull/30766
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Denys Otrishko &lt;shishugi@gmail.com&gt;
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: David Carlier &lt;devnexen@gmail.com&gt;
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>assert: special handle identical error names in instance checks</title>
<updated>2019-10-01T20:56:01+00:00</updated>
<author>
<name>Ruben Bridgewater</name>
<email>ruben@bridgewater.de</email>
</author>
<published>2019-06-15T11:54:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=48d1ea5e7fc918ae9f74d8472785720a13a755e6'/>
<id>48d1ea5e7fc918ae9f74d8472785720a13a755e6</id>
<content type='text'>
This makes sure that using `assert.throws()` or `assert.rejects()`
in combination with Error classes log appropriate error messages
in case the expected and received constructor name are identical
but not part of the same prototype chain.

PR-URL: https://github.com/nodejs/node/pull/28263
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
Reviewed-By: Benjamin Gruenbaum &lt;benjamingr@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes sure that using `assert.throws()` or `assert.rejects()`
in combination with Error classes log appropriate error messages
in case the expected and received constructor name are identical
but not part of the same prototype chain.

PR-URL: https://github.com/nodejs/node/pull/28263
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
Reviewed-By: Benjamin Gruenbaum &lt;benjamingr@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>assert: add more information to AssertionErrors</title>
<updated>2019-10-01T20:56:01+00:00</updated>
<author>
<name>Ruben Bridgewater</name>
<email>ruben@bridgewater.de</email>
</author>
<published>2019-06-15T11:27:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=97c52ca5dc0b9c4df015dc36ef394ebe06ec00c6'/>
<id>97c52ca5dc0b9c4df015dc36ef394ebe06ec00c6</id>
<content type='text'>
This adds information about the actual thrown error to the
AssertionError's message property.

It also improves the logged error instances error name by using the
constructors name, if available.

PR-URL: https://github.com/nodejs/node/pull/28263
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
Reviewed-By: Benjamin Gruenbaum &lt;benjamingr@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds information about the actual thrown error to the
AssertionError's message property.

It also improves the logged error instances error name by using the
constructors name, if available.

PR-URL: https://github.com/nodejs/node/pull/28263
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
Reviewed-By: Benjamin Gruenbaum &lt;benjamingr@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
