summaryrefslogtreecommitdiff
path: root/test/parallel/test-stdout-close-catch.js
Commit message (Collapse)AuthorAgeFilesLines
* lib: correct error.errno to always be numericJoyee Cheung2019-06-171-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Historically `error.errno` of system errors thrown by Node.js can sometimes be the same as `err.code`, which are string representations of the error numbers. This is useless and incorrect, and results in an information loss for users since then they will have to resort to something like `process.binding('uv'[`UV_${errno}`])` to get to the numeric error codes. This patch corrects this behavior by always setting `error.errno` to be negative numbers. For fabricated errors like `ENOTFOUND`, `error.errno` is now undefined since there is no numeric equivalent for them anyway. For c-ares errors, `error.errno` is now undefined because the numeric representations (negated) can be in conflict with libuv error codes - this is fine since numeric codes was not available for c-ares errors anyway. Users can use the public API `util.getSystemErrorName(errno)` to retrieve string codes for these numbers. PR-URL: https://github.com/nodejs/node/pull/28140 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* test: remove unused catch bindingscjihrig2018-11-061-1/+1
| | | | | | PR-URL: https://github.com/nodejs/node/pull/24079 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Wyatt Preul <wpreul@gmail.com>
* test: begin normalizing fixtures useJames M Snell2017-08-071-2/+2
| | | | | | | | | | | | | | | | | | | | | Adds a new `../common/fixtures' module to begin normalizing `test/fixtures` use. Our test code is a bit inconsistent with regards to use of the fixtures directory. Some code uses `path.join()`, some code uses string concats, some other code uses template strings, etc. In mnay cases, significant duplication of code is seen when accessing fixture files, etc. This updates many (but by no means all) of the tests in the test suite to use the new consistent API. There are still many more to update, which would make an excelent Code-n-Learn exercise. PR-URL: https://github.com/nodejs/node/pull/14332 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* test: replace concatenation with template literalsZongmin Lei2017-07-221-3/+3
| | | | | | | | | | | | * test/parallel/test-stdout-close-catch.js PR-URL: https://github.com/nodejs/node/pull/14298 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: cleanup test-stdout-close-catch.jsTravis Bretton2016-12-161-16/+19
| | | | | | | | | | | | Added common.mustCall in child process on 'close' callback Changed several 'var' statements to 'const' or 'let' where appropriate Also linting PR-URL: https://github.com/nodejs/node/pull/10006 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
* test: fix flaky test-stdout-close-catchSantiago Gimeno2016-05-181-1/+1
| | | | | | | | | | | Make sure that `catch-stdout-error` has written data before the destination process exits. Fixes: https://github.com/nodejs/node/issues/6791 PR-URL: https://github.com/nodejs/node/pull/6808 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
* test,benchmark: use deepStrictEqual()Rich Trott2016-04-221-1/+1
| | | | | | | | | | | | In preparation for a lint rule that will enforce assert.deepStrictEqual() over assert.deepEqual(), change tests and benchmarks accordingly. For tests and benchmarks that are testing or benchmarking assert.deepEqual() itself, apply a comment to ignore the upcoming rule. PR-URL: https://github.com/nodejs/node/pull/6213 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* test: move more tests from sequential to parallelSantiago Gimeno2016-04-201-0/+34
Only `test-stdin-from-file.js` has been modified so that the `stdin.txt` is written in a temp directory instead of the `fixtures` directory. PR-URL: https://github.com/nodejs/node/pull/6187 Reviewed-By: James M Snell <jasnell@gmail.com>