0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test
Sam Roberts f76722686b test: use assert.throw to test exceptions
The test wasn't checking directly that an assertion was thrown. Instead,
it was checking that spawn did not sucessfully spawn a non-existent
command.

However, the command chosen, dir, exists in GNU coreutils, so it exists
on Linux (though not on BSD derived OS X). The test as written passed on
Linux, even with the TypeError it is supposed to be checking for deleted
from spawn(). It would also pass on Windows if a ls.exe existed.

The approach is unnecessarily obscure, assert.throw() is for asserting
code throws, using it is more clear and works regardless of what
commands do or do not exist.

PR-URL: https://github.com/joyent/node/pull/8454
Reviewed-by: Trevor Norris <trev.norris@gmail.com>

Cherry-picked-from: 2ff29cc7e3

Conflicts:
	test/parallel/test-child-process-spawn-typeerror.js
2015-01-13 03:28:32 +01:00
..
addons Remove excessive copyright/license boilerplate 2015-01-12 15:30:28 -08:00
debugger Remove excessive copyright/license boilerplate 2015-01-12 15:30:28 -08:00
disabled Remove excessive copyright/license boilerplate 2015-01-12 15:30:28 -08:00
fixtures Remove excessive copyright/license boilerplate 2015-01-12 15:30:28 -08:00
gc
internet Remove excessive copyright/license boilerplate 2015-01-12 15:30:28 -08:00
message test: fix message tests regression 2015-01-13 01:50:32 +01:00
parallel test: use assert.throw to test exceptions 2015-01-13 03:28:32 +01:00
pummel Remove excessive copyright/license boilerplate 2015-01-12 15:30:28 -08:00
sequential Remove excessive copyright/license boilerplate 2015-01-12 15:30:28 -08:00
testpy test: fix make test-addons target 2015-01-12 23:21:51 +01:00
timers test: make test runner multi-arch/mode compatible 2014-10-16 22:39:34 +02:00
common.js test: check for multi-localhost support 2015-01-13 03:28:31 +01:00