0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 07:53:06 +01:00
Commit Graph

21 Commits

Author SHA1 Message Date
cjihrig
04b4d15b39 test: use mustCall() for simple flow tracking
Many of the tests use variables to track when callback functions
are invoked or events are emitted. These variables are then
asserted on process exit. This commit replaces this pattern in
straightforward cases with common.mustCall(). This makes the
tests easier to reason about, leads to a net reduction in lines
of code, and uncovered a few bugs in tests. This commit also
replaces some callbacks that should never be called with
common.fail().

PR-URL: https://github.com/nodejs/node/pull/7753
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-07-18 17:14:16 -04:00
Michaël Zasso
d1aabd6264 test: fix style issues after eslint update
Replace var keyword with const or let.

PR-URL: https://github.com/nodejs/io.js/pull/2286
Reviewed-By: Roman Reiss <me@silverwind.io>
2016-01-13 23:16:17 +01:00
Rich Trott
6abd8b587e test: remove unused modules
Many tests use require() to import modules that subsequently never gets
used. This removes those imports and, in a few cases, removes other
unused variables from tests.

PR-URL: https://github.com/nodejs/node/pull/4475
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2016-01-01 16:37:02 -08:00
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
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
Ben Noordhuis
018e110cd1 test: replace .addListener() calls with .on() 2011-10-15 01:08:36 +02:00
Mikeal Rogers
48dcb905f6 Update tests for http2. 2011-08-02 12:12:14 -07:00
Ryan Dahl
55048cdf79 Update copyright headers 2011-03-14 17:37:05 -07:00
Ryan Dahl
7a16e2a2a0 test-http-client-reconnect-bug: hang up should be error. 2011-01-20 18:19:30 -08:00
Oleg Efimov
093dfaf801 GJSLint all tests, only 3 long lines left in test-url.js
test/simple/test-url.js:31:(0110) Line too long (82 characters).
test/simple/test-url.js:39:(0110) Line too long (85 characters).
test/simple/test-url.js:40:(0110) Line too long (92 characters).
2010-12-05 15:42:41 -08:00
Ryan Dahl
a0159b4b29 Fix global leaks 2010-12-04 15:58:50 -08:00
Oleg Efimov
c0d69a4883 GJSLint part of tests 2010-12-02 17:49:23 -08:00
Micheil Smith
e38eb0c5a4 Soft migration of sys -> util, Removal of deprecated utils module. 2010-10-11 15:21:36 -07:00
Ryan Dahl
9395786d11 Fix race conditions in tests 2010-08-10 17:48:37 -07:00
Ryan Dahl
9fd5e3c89c Update tests to work with module contexts 2010-07-15 14:21:31 -07:00
Ryan Dahl
ba792ea202 :%s/sys.puts/console.log/g
and there was much rejoicing
2010-06-23 20:05:29 -07:00
Ryan Dahl
cb79614f73 Don't encourage strange ideas about req race conditions 2010-06-20 11:56:48 -07:00
Ryan Dahl
50c70ac714 Update stream API: forceClose() -> destroy(), close() -> end() 2010-04-08 12:24:29 -07:00
isaacs
5861db8a69 Remove process.mixin dependency from all tests. 2010-03-08 17:57:04 -08:00
arlolra
724ccf10df Tests on common port. 2010-02-26 12:20:10 -08:00
arlolra
04fac19822 Split tests. 2010-02-25 11:41:11 -08:00