Commit Graph

24 Commits

Author SHA1 Message Date
Antoine du Hamel
873e5ce54a
test: add trailing commas in test/pummel
PR-URL: https://github.com/nodejs/node/pull/46610
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2023-02-12 17:36:39 +01:00
Rich Trott
97c8abe2c0 test: remove common.PORT from assorted pummel tests
Use port "0" for an OS-provided open port instead of common.PORT.

PR-URL: https://github.com/nodejs/node/pull/31897
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2020-02-23 02:45:50 -08:00
sreepurnajasti
e08cf1d230
test: improve to use template string
PR-URL: https://github.com/nodejs/node/pull/18097
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2018-01-17 08:50:02 +08:00
Miguel Angel Asencio Hurtado
9a5c3cf185
test: continue normalizing fixtures use
PR-URL: https://github.com/nodejs/node/pull/14716
Refs: https://github.com/nodejs/node/pull/14332
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
2017-08-27 21:14:34 -03:00
Vse Mozhet Byt
2d2986ae72 test: simplify test skipping
* Make common.skip() exit.

  Also add common.printSkipMessage() for partial skips.

* Don't make needless things before skip

PR-URL: https://github.com/nodejs/node/pull/14021
Fixes: https://github.com/nodejs/node/issues/14016
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-07-04 12:41:49 +03:00
Vse Mozhet Byt
8b76c3e60c test: reduce string concatenations
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-05 17:39:05 +03:00
James M Snell
98e54b0bd4 meta: restore original copyright header
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-03-10 11:23:48 -08:00
Gibson Fahnestock
3d2aef3979 test: s/assert.equal/assert.strictEqual/
Use assert.strictEqual instead of assert.equal in tests, manually
convert types where necessary.

PR-URL: https://github.com/nodejs/node/pull/10698
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
2017-01-11 14:19:26 +00:00
Gibson Fahnestock
7a0e462f9f test: use eslint to fix var->const/let
Manually fix issues that eslint --fix couldn't do automatically.

PR-URL: https://github.com/nodejs/node/pull/10685
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2017-01-11 11:43:52 +00:00
cjihrig
ff1efa6087 test: use const for all require() calls
PR-URL: https://github.com/nodejs/node/pull/10550
Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-01-02 18:28:18 -05:00
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
Jeremiah Senkpiel
52bae222a3 test: abstract skip functionality to common
The tap skipping output is so prevalent yet obscure in nature that we
ought to move it into it's own function in test/common.js

PR-URL: https://github.com/nodejs/node/pull/6697
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
2016-05-12 16:43:35 -04:00
Jackson Tian
4d78121b77 lib: simplify code with String.prototype.repeat()
use String.prototype.repeat() to simplify code, less code,
more semantically.

PR-URL: https://github.com/nodejs/node/pull/5359
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-03-21 16:42:58 -07:00
Sakthipriyan Vairamani
79c865a53f test: changing process.exit to return while skipping tests
This patch uses `return` statement to skip the test instead of using
`process.exit` call.

PR-URL: https://github.com/nodejs/io.js/pull/2109
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-07-20 15:50:42 +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
Johan Bergström
671fbd5a9d test: refactor all tests that depends on crypto
we had a few ways versions of looking for support before executing a test. this
commit unifies them as well as add the check for all tests that previously
lacked them. found by running `./configure --without-ssl && make test`. also,
produce tap skip output if the test is skipped.

PR-URL: https://github.com/iojs/io.js/pull/1049
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
2015-03-05 10:31:41 +09: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
3806cf0d64 test: set rejectUnauthorized in tls/https tests
Update the tls and https tests to explicitly set rejectUnauthorized instead of
relying on the NODE_TLS_REJECT_UNAUTHORIZED environment variable getting set.
2012-09-15 00:19:30 +02:00
Ben Noordhuis
35607f3a2d tls, https: validate server certificate by default
This commit changes the default value of the rejectUnauthorized option from
false to true.

What that means is that tls.connect(), https.get() and https.request() will
reject invalid server certificates from now on, including self-signed
certificates.

There is an escape hatch: if you set the NODE_TLS_REJECT_UNAUTHORIZED
environment variable to the literal string "0", node.js reverts to its
old behavior.

Fixes #3949.
2012-09-15 00:19:06 +02:00
Ryan Dahl
850609ea2d Remove separation of libuv tests 2011-11-02 16:38:59 -07:00
Colton Baker
87286cc737 Fixed a lot of jslint errors.
Fixes #1831
2011-10-05 18:51:06 -07:00
Ryan Dahl
4e1d6fca8e Mark tests which are broken in libuv 2011-08-23 23:45:21 -07:00
Ryan Dahl
55048cdf79 Update copyright headers 2011-03-14 17:37:05 -07:00
Ryan Dahl
7f78e5857f Move test-tls-throttle to pummel 2011-02-16 18:12:08 -08:00