summaryrefslogtreecommitdiff
path: root/test/parallel/test-os.js
AgeCommit message (Collapse)Author
2018-11-14os: do not call into JS to push values to an array in GetCPUInfoJoyee Cheung
Instead of calling into JS from C++ to push values into an array, use the new Array::New API that takes a pointer and a length directly. PR-URL: https://github.com/nodejs/node/pull/24264 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-08-20os: improve networkInterfaces performanceRuben Bridgewater
This algorithm uses less data transformations and is therefore significantly faster than the one before. PR-URL: https://github.com/nodejs/node/pull/22359 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-04-01tools: add 'spaced-comment' into eslint rulesWeijia Wang
PR-URL: https://github.com/nodejs/node/pull/19596 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2018-01-11test: fix spelling in test case commentsTobias Nießen
PR-URL: https://github.com/nodejs/node/pull/18018 Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
2017-12-08test: use Number.isNaN instead of global isNaNMithun Sasidharan
PR-URL: https://github.com/nodejs/node/pull/17515 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-10-22test: handle blank shells in test-os.jsGibson Fahnestock
The shell in /etc/passwd can be blank, in which case the user is given the default shell. Handle this by only checking the shell contains a path separator if the string isn't empty. PR-URL: https://github.com/nodejs/node/pull/16287 Fixes: https://github.com/nodejs/node/issues/15684 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-10-02test: increase test coverage for os.jskuroljov
PR-URL: https://github.com/nodejs/node/pull/14098 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-14os: add CIDR supportMudit Ameta
This patch adds support for CIDR notation to the output of the `networkInterfaces()` method PR-URL: https://github.com/nodejs/node/pull/14307 Fixes: https://github.com/nodejs/node/issues/14006 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@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-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-07-16test: change isAix to isAIX章礼平
This makes the naming more consistent with existing properties like isFreeBSD where the capitalization of the property name is consistent with the conventional styling of the operating system. PR-URL: https://github.com/nodejs/node/pull/14263 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Bryan English <bryan@bryanenglish.com>
2017-05-05test: reduce string concatenationsVse Mozhet Byt
PR-URL: https://github.com/nodejs/node/pull/12735 Refs: https://github.com/nodejs/node/pull/12455 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-05-01test,lib,doc: use function declarationsRich Trott
Replace function expressions with function declarations in preparation for a lint rule requiring function declarations. PR-URL: https://github.com/nodejs/node/pull/12711 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-05-01test: remove extra console output from test-os.jsJames M Snell
PR-URL: https://github.com/nodejs/node/pull/12654 Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2017-05-01os: refactor os structure, add Symbol.toPrimitiveJames M Snell
Refactor the structure of the os module to use more efficient module.exports = {} pattern. Add Symbol.toPrimitive support to os methods that return simple primitives. This is a minor tweak that makes using these slightly more friendly when doing things like: ```js var m = `${os.tmpdir}/foo` ``` PR-URL: https://github.com/nodejs/node/pull/12654 Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2017-03-10meta: restore original copyright headerJames M Snell
A prior io.js era commit inappropriately removed the original copyright statements from the source. This restores those in any files still remaining from that edit. Ref: https://github.com/nodejs/TSC/issues/174 Ref: https://github.com/nodejs/node/pull/10599 PR-URL: https://github.com/nodejs/node/pull/10155 Note: This PR was required, reviewed-by and approved by the Node.js Foundation Legal Committee and the TSC. There is no `Approved-By:` meta data.
2017-01-06benchmark,lib,test: adjust for lintingRich Trott
Formatting changes for upcoming linter update. PR-URL: https://github.com/nodejs/node/pull/10561 Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2016-12-27os: fix os.release() for aix and add testjBarz
PR-URL: https://github.com/nodejs/node/pull/10245 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-09-30test: cleanup/update test-os.jsMike Woods
Replaced `==` with `=== Replaced `indexOf(...) !== -1` with `includes()` PR-URL: https://github.com/nodejs/node/pull/8761 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
2016-09-21test: cleanup test-os.jsdelvedor
Moved from var to const. Moved from .equal to .strictEqual. Added more checks about the type of the returned values. PR-URL: https://github.com/nodejs/node/pull/8606 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
2016-07-27test: use common platform helpers everywhereSantiago Gimeno
Use the common.isWindows, common.isFreeBSD and common.isSunOS where possible. Add common.isOSX and common.isLinux. Fix `test-fs-read-file-sync-hostname` as in its current form was not being run anywhere. PR-URL: https://github.com/nodejs/node/pull/7845 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-04-22test,benchmark: use deepStrictEqual()Rich Trott
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>
2016-04-12os: add userInfo() methodcjihrig
os.userInfo() calls libuv's uv_os_get_passwd() function. It returns an object containing the current effective user's username, uid, gid, shell, and home directory. On Windows, the uid and gid are -1, and the shell is null. Refs: https://github.com/nodejs/node/issues/5582 PR-URL: https://github.com/nodejs/node/pull/6104 Reviewed-By: James M Snell <jasnell@gmail.com>
2016-02-02test: fix var redeclarations in test-osRich Trott
PR-URL: https://github.com/nodejs/node/pull/4990 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Roman Klauke <romaaan.git@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: James M Snell <jasnell@gmail.com>
2015-06-05os: add homedir()cjihrig
os.homedir() calls libuv's uv_os_homedir() to retrieve the current user's home directory. PR-URL: https://github.com/nodejs/io.js/pull/1791 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Rod Vagg <rod@vagg.org>
2015-05-19test: enable linting for testsRoman Reiss
Enable linting for the test directory. A number of changes was made so all tests conform the current rules used by lib and src directories. The only exception for tests is that unreachable (dead) code is allowed. test-fs-non-number-arguments-throw had to be excluded from the changes because of a weird issue on Windows CI. PR-URL: https://github.com/nodejs/io.js/pull/1721 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-05-13os: refine tmpdir() trailing slash strippingcjihrig
os.tmpdir() began stripping trailing slashes in b57cc51d8d3f4ad279591ae8fa6584ee22773b97. This causes problems if the temp directory is simply '/'. It also stripped trailing slashes without first determining which slash type is used by the current operating system. This commit only strips trailing slashes if another character precedes the slash. On Windows, it checks for ':', as not to strip slashes from something like 'C:\'. It also only strips slashes that are appropriate for the user's operating system. Fixes: https://github.com/iojs/io.js/issues/1669 PR-URL: https://github.com/iojs/io.js/pull/1673 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Christian Tellnes <christian@tellnes.no>
2015-04-28os: remove trailing slash from os.tmpdir()Christian Tellnes
This commit makes `os.tmpdir()` behave consistently on all platforms. It changes `os.tmpdir()` to always return a path without trailing slash. Semver: major Fixes: https://github.com/iojs/io.js/issues/715 PR-URL: https://github.com/iojs/io.js/pull/747 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-12Remove excessive copyright/license boilerplateisaacs
The copyright and license notice is already in the LICENSE file. There is no justifiable reason to also require that it be included in every file, since the individual files are not individually distributed except as part of the entire package.
2014-12-17test: split test in parallel/sequentialFedor Indutny
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> PR-URL: https://github.com/iojs/io.js/pull/172 Fix: iojs/io.js#139