summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2017-08-14http2: fix [kInspect]() output for Http2StreamEvan Lucas
This fixes a typo in the util.inspect output of Http2Stream. It previously had writeableSate instead of writableState. PR-URL: https://github.com/nodejs/node/pull/14753 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-08-14test: cover all HTTP methods that parser supportsOky Antoro
Cover all request methods that Node's HTTP parser supports in parallel/test-http-methods. PR-URL: https://github.com/nodejs/node/pull/14773 Refs: https://github.com/nodejs/node/issues/14544 Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-14test: add test to verify ErrnoException pathDaniel Bevenius
This commit adds a test to verify that the path argument to ErrnoException can contain UTF-8 characters. PR-URL: https://github.com/nodejs/node/pull/13958 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-08-14test: use regular expressions in throw assertionsVincent Xue
Test errors thrown in addons-napi/test_constructor more specifically. PR-URL: https://github.com/nodejs/node/pull/14318 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-08-13test: invoke callback with common.mustCall()Griffith Tchenpan
* invoke callback with `common.mustCall()` in test-crypto-hash * order module declarations aphabetically per test-writing-guide PR-URL: https://github.com/nodejs/node/pull/8597 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-08-13util: improve util.inspect performanceRuben Bridgewater
* improve util.inspect performance This is a huge performance improvement in case of sparse arrays when using util.inspect as the hole will simple be skipped. * use faster visibleKeys property lookup * add inspect-array benchmark PR-URL: https://github.com/nodejs/node/pull/14492 Fixes: https://github.com/nodejs/node/issues/14487 Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-13http2: improve perf of passing headers to C++Anna Henningsen
By passing a single string rather than many small ones and a single block allocation for passing headers, save expensive interactions with JS values and memory allocations. PR-URL: https://github.com/nodejs/node/pull/14723 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-13repl: include folder extensions in autocompleteTeddy Katz
When autocompleting `require` calls, the repl strips .js file extensions from results. However, stripping an extension from a directory results in an error. Update the autocompletion logic to avoid stripping extensions from directories. PR-URL: https://github.com/nodejs/node/pull/14727 Fixes: https://github.com/nodejs/node/issues/14726 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
2017-08-12test: add test-benchmark-arraysRich Trott
Add minimal test to confirm that arrays benchmarks run. PR-URL: https://github.com/nodejs/node/pull/14728 Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-08-12n-api: add napi_get_node_versionAnna Henningsen
Add `napi_get_node_version`, to help with feature-detecting Node.js as an environment. PR-URL: https://github.com/nodejs/node/pull/14696 Reviewed-By: Kyle Farnung <kfarnung@microsoft.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-12test: allow inspector to reopen with same portGibson Fahnestock
Test checks that if you open the inspector with '0' (pick a random free port), close it, then reopen it, you get a different port. However this isn't necessarily true. PR-URL: https://github.com/nodejs/node/pull/14320 Fixes: https://github.com/nodejs/node/issues/14316 Refs: https://github.com/nodejs/node/issues/14316#issuecomment-315680755 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-08-11test: make test-tls-alert-handling more strictRich Trott
Use `common.mustCall()` and `common.mustNotCall()` to more rigorously check that functions (especially no-op error handlers) are called the expected number of times in test-tls-alert-handling. PR-URL: https://github.com/nodejs/node/pull/14650 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: David Cai <davidcai1993@yahoo.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-11Revert "inspector: rewrite inspector test helper"Anna Henningsen
This reverts commit 2296b677fb1e2ea71e86a899b028ba9e817e86ad. That commit was landed without a green CI and is failing on Windows. Ref: https://github.com/nodejs/node/pull/14460 PR-URL: https://github.com/nodejs/node/pull/14777 Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-11test: remove redundant `using` in cctestXadillaX
PR-URL: https://github.com/nodejs/node/pull/14739 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
2017-08-11test: make totalLen snake caseDaniel Bevenius
For consistency, use snake case (total_len) for the local totalLen variable. PR-URL: https://github.com/nodejs/node/pull/14765 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-08-11inspector: support extra contextsEugene Ostroukhov
This enables inspector support for contexts created using the vm module. PR-URL: https://github.com/nodejs/node/pull/14465 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
2017-08-11test: check crypto before requiring tls moduleDaniel Bevenius
test-tls-session-cache currently fails if built --without-ssl: internal/util.js:82 throw new errors.Error('ERR_NO_CRYPTO'); ^ Error [ERR_NO_CRYPTO]: Node.js is not compiled with OpenSSL crypto support at Object.assertCrypto (internal/util.js:82:11) at tls.js:26:14 at NativeModule.compile (bootstrap_node.js:586:7) at Function.NativeModule.require (bootstrap_node.js:531:18) at Function.Module._load (module.js:449:25) at Module.require (module.js:517:17) at require (internal/module.js:11:18) at Object.<anonymous> (/node/test/parallel/test-tls-session-cache.js:26:13) at Module._compile (module.js:573:30) at Object.Module._extensions..js (module.js:584:10) The test has a crypto check but it come after the require of the tls module. This commit moves the crypto check to come before the require of tls and allows the test to pass. PR-URL: https://github.com/nodejs/node/pull/14708 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: David Cai <davidcai1993@yahoo.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-10inspector: rewrite inspector test helperEugene Ostroukhov
Helper was rewritten to rely on promises instead of manually written queue and callbacks. This simplifies the code and makes it easier to maintain and extend. PR-URL: https://github.com/nodejs/node/pull/14460 Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-11test: increase http2 coverageMichael Albert
Added tests for `getPackedSettings` to check for not passing `settings` and for `getUnpackedSettings` to check for a few cases when passing `{ validate: true }`. PR-URL: https://github.com/nodejs/node/pull/14701 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-10test: make test-tls-connect checks more strictRich Trott
Check the error code on expected errors so that the introduction of different errors in refactoring is caught. While at it, re-order modules alphabetically per test-writing guide. PR-URL: https://github.com/nodejs/node/pull/14695 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-08-10Revert "test: disable MultipleEnvironmentsPerIsolate"Anna Henningsen
This reverts commit 95ab966a742d23d7271c7b4c36fb84aa2bbece59. Ref: https://github.com/nodejs/node/issues/14206 Ref: https://github.com/nodejs/node/pull/14246 PR-URL: https://github.com/nodejs/node/pull/14749 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2017-08-10Revert "test: add DISABLED_ prefix to commented out test"Anna Henningsen
This reverts commit 75bf8a9db9e6005c6b5a5beb086a9def6e1c1b76. Ref: https://github.com/nodejs/node/issues/14206 Ref: https://github.com/nodejs/node/pull/14317 PR-URL: https://github.com/nodejs/node/pull/14749 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2017-08-10test: properly order freeing resources in cctestAnna Henningsen
The `IsolateData` instance is created before the `Environment` instance, so free in reverse order. Fixes: https://github.com/nodejs/node/issues/14206 PR-URL: https://github.com/nodejs/node/pull/14749 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2017-08-10process: make `this` value consistentRich Trott
The value of `this` for callbacks of `nextTick()` can vary depending on the number of arguments. Make it consistent. PR-URL: https://github.com/nodejs/node/pull/14645 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-10test: check `this` value for `nextTick()`Rich Trott
Depending on how many arguments are provided, `nextTick()` may run its callback with `this` set to `null` or not. Add assertions for both cases. PR-URL: https://github.com/nodejs/node/pull/14645 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-10fs: invoke callbacks with undefined contextRich Trott
Many callbacks appear to be invoked with `this` set to `undefined` including `fs.stat()`, `fs.lstat()`, and `fs.fstat()`. However, some such as `fs.open()` and `fs.mkdtemp()` invoke their callbacks with `this` set to `null`. Change to `undefined`. PR-URL: https://github.com/nodejs/node/pull/14645 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-10test: refactor test-fs-statRich Trott
* add `use strict' * change checks that `this` is mapped to `global` in sloppy mode to checks that `this` is `undefined` * modify arguments to assertions to match docs (actual first, expected second) * add blank line below `common` declaration per test writing guide * use `assert.ifError()` as appropriate PR-URL: https://github.com/nodejs/node/pull/14645 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-10test: set module loading error for aixPrakash Palaniappan
In test/parallel/test-module-loading-error.js, an attempt is made to load a text file as a native executable. This results in an error message in a platform specific manner. AIX was not included in the list of platforms. This fix introduces the AIX error messages. PR-URL: https://github.com/nodejs/node/pull/14511 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-08-09test: split out load-sensitive readline testsRich Trott
Two test cases in `test-readline-interface` are sensitive to resource constraints (probably due to `\r` and `\n` not arriving within the appropriate delay to be treated as a single line ending). Move those tests to `sequential`. PR-URL: https://github.com/nodejs/node/pull/14681 Fixes: https://github.com/https://github.com/nodejs/node/issues/14674 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-09test: fix conversion of microseconds in testNick Stanish
PR-URL: https://github.com/nodejs/node/pull/14706 Fixes: https://github.com/nodejs/node/issues/8728 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-08-09test: improve check in test-osRich Trott
The check for `os.networkInterfaces()` in `test-os.js` may be too strict. It's apparently possible for a machine to be configured with multiple IPv4 loopback interfaces. Increase specificity of filter to check on only the object we expect. PR-URL: https://github.com/nodejs/node/pull/14655 Fixes: https://github.com/nodejs/node/issues/14654 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-08http2: rename some nghttp2 stream flagsKelvin Jin
This change makes NGHTTP2_STREAM_* enum values consistent. It also resolves a collision between enum values defined in nghttp2_error_code and nghttp2_stream_flags. PR-URL: https://github.com/nodejs/node/pull/14637 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-08-08child_process: fix handle passing w large payloadsAnna Henningsen
Fix situations in which the handle passed along with a message that has a large payload and can’t be read entirely by a single `recvmsg()` call isn’t associated with the message to which it belongs. PR-URL: https://github.com/nodejs/node/pull/14588 Fixes: https://github.com/nodejs/node/issues/13778 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-08-08test: replace indexOf with includesMiguel Angel Asencio Hurtado
Refs: https://github.com/nodejs/node/issues/12586 PR-URL: https://github.com/nodejs/node/pull/14630 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
2017-08-08test: add crypto check to http2 testsDaniel Bevenius
When building --without-ssl and running the tests some of the http2 test fail with the following error message: internal/util.js:82 throw new errors.Error('ERR_NO_CRYPTO'); ^ Error [ERR_NO_CRYPTO]: Node.js is not compiled with OpenSSL crypto support at Object.assertCrypto (internal/util.js:82:11) at internal/http2/core.js:5:26 at NativeModule.compile (bootstrap_node.js:586:7) at NativeModule.require (bootstrap_node.js:531:18) at http2.js:17:5 at NativeModule.compile (bootstrap_node.js:586:7) at Function.NativeModule.require (bootstrap_node.js:531:18) at Function.Module._load (module.js:449:25) at Module.require (module.js:517:17) at require (internal/module.js:11:18) This commit adds hasCrypto checks and skips the tests if there is no crypto support. PR-URL: https://github.com/nodejs/node/pull/14657 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-08test: fix test-readline-interfaceAzard
Previous unit test delay is too short for parallel test on raspberry pi, it will fail sometimes. This PR use common.platformTimeout and widen the time gap. PR-URL: https://github.com/nodejs/node/pull/14677 Ref: https://github.com/nodejs/node/issues/14674 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-08-08stream: support readable/writableHWM for DuplexGuy Margalit
This commits adds support for readableHighWaterMark and writableHighWaterMark in Duplex stream, so that they can be set without accessing the internal state. Fixes: https://github.com/nodejs/node/issues/14555 PR-URL: https://github.com/nodejs/node/pull/14636 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-08-07console: coerce label to string in console.time()James M Snell
Per the console spec, the label in console.time() is a string. Per the console spec, the default value of label is `'default'`. PR-URL: https://github.com/nodejs/node/pull/14643 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-08-07src: adjust windows abort behaviorJared Kantrowitz
Raising SIGABRT is handled in the CRT in windows, calling _exit() with ambiguous code "3" by default. This adjustment to the abort behavior gives a more sane exit code on abort, by calling _exit directly with code 134. PR-URL: https://github.com/nodejs/node/pull/13947 Fixes: https://github.com/nodejs/node/issues/12271 Refs: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/abort Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-08-07test: begin normalizing fixtures useJames M Snell
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>
2017-08-07test: improve multiple timers testsJames M Snell
PR-URL: https://github.com/nodejs/node/pull/14616 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-07n-api: optimize number API performanceJason Ginchereau
- Add separate APIs for creating different kinds of numbers, because creating a V8 number value from an integer is faster than creating one from a double. - When getting number values, avoid getting the current context because the context will not actually be used and is expensive to obtain. - When creating values, don't use v8::TryCatch (NAPI_PREAMBLE), because these functions have no possibility of executing JS code. Refs: https://github.com/nodejs/node/issues/14379 PR-URL: https://github.com/nodejs/node/pull/14573 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-08-07test: use ciphers supported by shared OpenSSLJérémy Lal
On Debian with OpenSSL 1.1 CLI, the ciphers used in those tests were unknown. PR-URL: https://github.com/nodejs/node/pull/14566 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-07test: mitigate RegEx exceeding 80 charsAditya Anand
Format commit wrapping lines containing RegEx and exceeding 80 chars. PR-URL: https://github.com/nodejs/node/pull/14607 Fixes: https://github.com/nodejs/node/issues/14586 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-08-06test: add block scoping to test-readline-interfaceRich Trott
Use block-scoping in test-readline-interface to avoid side effects and make tests more modular. (Some contain race conditions and will need to be moved to the sequential directory if they can't be refactored to avoid the race condition.) PR-URL: https://github.com/nodejs/node/pull/14615 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-07inspector: allow require in Runtime.evaluateJan Krems
Some parts were written by Timothy Gu <timothygu99@gmail.com>. PR-URL: https://github.com/nodejs/node/pull/8837 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Aleksei Koziatinskii <ak239spb@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-08-06src: avoid dereference without existence checkTimothy Gu
Currently the URL API is only used from the JS binding, which always initializes `base` regardless of `has_base`. Therefore, there is no actual security risk right now, but would be had we made other C++ parts of Node.js use this API. An earlier version of this patch was created by Bradley Farias <bradley.meck@gmail.com>. PR-URL: https://github.com/nodejs/node/pull/14591 Refs: https://github.com/nodejs/node/pull/14369#discussion_r128767221 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-05test: explain sloppy mode for test-globalRich Trott
Add a comment explaining why test-global runs in sloppy mode rather than strict mode. While in the file, make some minor changes to the module ordering and spacing to conform with our test writing guide. Also reordered arguments in `assert.strictEqual()` to match documentation. PR-URL: https://github.com/nodejs/node/pull/14604 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-08-05encoding: rudimentary TextDecoder support w/o ICUTimothy Gu
Also split up the tests. PR-URL: https://github.com/nodejs/node/pull/14489 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-05test: fix test-readline-position w/o ICUTimothy Gu
PR-URL: https://github.com/nodejs/node/pull/14489 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>