0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 15:30:56 +01:00
Commit Graph

12 Commits

Author SHA1 Message Date
cjihrig
e9bb3329ea test: add common.rootDir
A few of the child process tests can be simplified by computing
the OS specific root directory in common and then accessing that
value.

PR-URL: https://github.com/nodejs/node/pull/7685
Reviewed-By: Roman Reiss <me@silverwind.io>
2016-07-14 10:06:13 -04:00
cjihrig
6bad85c4fd test: refactor spawnSync() cwd test
This commit refactors test-child-process-spawnsync.js to use
the reusable common.spawnSyncPwd().

PR-URL: https://github.com/nodejs/node/pull/6939
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-05-24 09:59:11 -04:00
cjihrig
dc76afffb6 child_process: allow buffer encoding in spawnSync
When the 'buffer' encoding is passed to spawnSync(), an exception
is thrown in Buffer's toString() method because 'buffer' is not
a valid encoding there. This commit special cases the 'buffer'
encoding.

Fixes: https://github.com/nodejs/node/issues/6930
PR-URL: https://github.com/nodejs/node/pull/6939
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-05-24 09:59:11 -04:00
Rich Trott
a7335bd1f0 test,benchmark: use deepStrictEqual()
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-22 14:38:09 -07:00
Myles Borins
6c032a8333 test: replace util with backtick strings
Now that we have backticks we no longer need to use util.format
to template strings!

This commit was inspired by #3324, and it replaces instances of
util.format with backtick strings in a number of tests

Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3359
2015-10-14 10:02:47 -07:00
Rich Trott
fffa4c2528 test: speed up test-child-process-spawnsync.js
There's a bunch of stuff in test-child-process-spawnsync.js that seems
designed to test that it is in fact blocking/synchronous. However, that
code really just tests the OS sleep command. Change `sleep 1` to `sleep
0` and shave about one second off the test run.`

We check the return status to confirm the command is successful. The
tests in this file in general would not work if spawnSync() were
asynchronous. That includes this one, as a return status would not be
available if the command where asynchronous.

PR-URL: https://github.com/nodejs/node/pull/2542
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-08-25 13:16:58 -07:00
Rich Trott
7e63eb7762 test: make spawnSync() test robust
The test had checked that a timer fired within a period after
spawnSync() returns. The result was a test that sometimes was
flaky.

Because there's no guarantee of how long a timer will take
before running, remove the check. There is a check that the
timer runs after spawnSync() so that is sufficient.

PR-URL: https://github.com/nodejs/node/pull/2535
Fixes: https://github.com/nodejs/node/issues/2470
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-08-25 07:38:49 -07:00
Sakthipriyan Vairamani
d5ab92bcc1 test: use common.isWindows consistently
In the tests, we use "process.platform === 'win32'" in some places.
This patch replaces them with the "common.isWindows" for consistency.

PR-URL: https://github.com/nodejs/io.js/pull/2269
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-07-31 00:29:36 +05:30
Roman Reiss
f29762f4dd test: enable linting for tests
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-19 21:21:27 +02:00
cjihrig
d53b636d94 test: verify fields in spawn{Sync} errors
This commit validates the properties of ENOENT error objects
returned by spawn() and spawnSync().

PR-URL: https://github.com/iojs/io.js/pull/838
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-02-13 19:06:36 -05:00
isaacs
3e1b1dd4a9 Remove excessive copyright/license boilerplate
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.
2015-01-12 15:30:28 -08:00
Fedor Indutny
0e19476595 test: split test in parallel/sequential
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/iojs/io.js/pull/172
Fix: iojs/io.js#139
2014-12-17 20:45:02 +07:00