Michael Dawson
6bc82daef0
n-api: use module name macro
...
Update tests to use module name macro
PR-URL: https://github.com/nodejs/node/pull/16185
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-10-15 16:00:29 -07:00
Sebastiaan Deckers
bb29405904
lib,src: fix consistent spacing inside braces
...
PR-URL: https://github.com/nodejs/node/pull/14162
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-07-21 15:13:47 -04: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
Ben Noordhuis
75019dfa67
test: remove nan + weak
...
Since the previous commit obsoleted them, remove them.
PR-URL: https://github.com/nodejs/node/pull/11239
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
2017-02-11 14:21:32 +01:00
Ben Noordhuis
bae093a70b
test: remove dependency on node-weak
...
Replace node-weak with a small hand-rolled add-on. We can now drop
node-weak and nan, reducing the size of the source tree by about 750 kB
and the size of the tarball by about 150-300 kB.
PR-URL: https://github.com/nodejs/node/pull/11239
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
2017-02-11 14:21:29 +01:00
Ben Noordhuis
da52fcdcf5
test: don't call process.exit() in gc tests
...
Rewrite the tests in test/gc so that they no longer call process.exit().
Instead they exit gracefully now.
PR-URL: https://github.com/nodejs/node/pull/11239
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
2017-02-11 14:20:50 +01:00
Gibson Fahnestock
067be658f9
test: don't connect to :: (use localhost instead)
...
If a test does http.listen(0) or net.listen(0),
http.listen(0).address().address returns '::'. Some machines will
resolve this to localhost, but not all. Every machine should have
localhost defined in /etc/hosts (or equivalent), so it should always
resolve.
Fixes: https://github.com/nodejs/node/issues/7291
PR-URL: https://github.com/nodejs/node/pull/10854
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michal Zasso <targos@protonmail.com >
2017-01-22 19:11:42 -08: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
746a46ebdd
test: increase usage of assert.ifError()
...
PR-URL: https://github.com/nodejs/node/pull/10543
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2017-01-02 09:48:52 -05:00
Rich Trott
5b2a8053cb
test: remove blank lines at end of files
...
In preparation for a lint rule that disallows empty lines at the end of
a file, remove such lines from a number of test files.
Refs: https://github.com/nodejs/node/issues/8918
PR-URL: https://github.com/nodejs/node/pull/8920
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com >
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2016-10-05 21:06:36 -07:00
Dany Shaanan
d469321946
tools: add eslint rule prefer-assert-methods
...
PR-URL: https://github.com/nodejs/node/pull/8622
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com >
Reviewed-By: Jackson Tian <shvyo1987@gmail.com >
Reviewed-By: Johan Bergström <bugs@bergstroem.nu >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Teddy Katz <teddy.katz@gmail.com >
2016-09-20 16:35:39 -07:00
Sakthipriyan Vairamani
612307564b
test: make import common as the first line
...
The `test/common` module has the capability to identify if any variable
is leaked to the global scope and fail the test. So that has to be
imported at the beginning.
PR-URL: https://github.com/nodejs/node/pull/7786
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2016-07-21 16:39:21 -07:00
cjihrig
4a408321d9
test: cleanup IIFE tests
...
A number of test files use IIFEs to separate distinct tests from
each other in the same file. The project has been moving toward
using block scopes and let/const in favor of IIFEs. This commit
moves IIFE tests to block scopes. Some additional cleanup such
as use of strictEqual() and common.mustCall() is also included.
PR-URL: https://github.com/nodejs/node/pull/7694
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com >
2016-07-14 22:07:14 -04:00
Rich Trott
0d7f313325
test: update weak module for gc tests
...
Previous version of weak used for gc tests emitted a warning on OS X.
Updating to current version eliminates warning.
PR-URL: https://github.com/nodejs/node/pull/7014
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-05-31 16:49:52 -07:00
Rich Trott
3b8e342278
test: remove common.PORT from gc tests
...
Allow the operating system to provide an arbitrary available port rather
than using `common.PORT`, as `common.PORT` makes it likely that a test
will fail with `EADDRINUSE` as a side effect of an earlier test.
PR-URL: https://github.com/nodejs/node/pull/7013
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2016-05-31 16:03:10 -07:00
Rich Trott
a56da51a38
benchmark,test,lib: remove extra spaces
...
In preparation for stricter linting, remove extra spaces.
PR-URL: https://github.com/nodejs/node/pull/6645
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: Roman Reiss <me@silverwind.io >
2016-05-11 23:18:16 -07:00
Rich Trott
6c49714df0
test,tools: limit lint tolerance of gc global
...
Lint rules permitted the `gc` global in any test file. This change
limits it to just the files that need it.
PR-URL: https://github.com/nodejs/node/pull/6324
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2016-04-28 19:22:16 -07:00
Rich Trott
7406cd3a59
tools: lint for spacing around unary operators
...
Enable `space-unary-ops` in `.eslintrc`. This prohibits things like:
i ++ // use `i++` instead
typeof(foo) // use `typeof foo` or `typeof (foo)` instead
Ref: https://github.com/nodejs/node/pull/4772#discussion_r51732299
PR-URL: https://github.com/nodejs/node/pull/5063
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-02-04 10:56:17 -08: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
521f51ac1c
test: only include http module once
...
A few tests in test/gc include the http module twice. Remove duplicate
require().
PR-URL: https://github.com/nodejs/node/pull/4606
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-01-11 10:16:58 -08:00
Devin Nakamura
2413a4e99d
test: fix race condition in test-http-client-onerror
...
Occasionally test-http-client-onerror will fail with a refused connection.
This patch fixes the possibility that connections will be attempted before
server is listening.
PR-URL: https://github.com/nodejs/node/pull/4346
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: Johan Bergström <bugs@bergstroem.nu >
Reviewed-By: James M Snell <jasnell@gmail.com >
2015-12-30 11:47:51 -08:00
Michaël Zasso
4abc896a82
src: replace usage of v8::Handle with v8::Local
...
v8::Handle is deprecated: https://codereview.chromium.org/1224623004
PR-URL: https://github.com/nodejs/io.js/pull/2202
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2015-09-06 21:38:05 +10:00
Brendan Ashworth
8af5962608
test: add spaces after keywords
...
eg changes:
if(x) { ... }
to:
if (x) { ... }
2015-08-22 18:01:53 -07: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
Brendan Ashworth
0df54303c1
test: common.js -> common
...
This commit changes many test styles to change all references
from require('./common.js'); to require('./common');.
The latter is much more common, with the former only being used in 50
tests. It is just a stylistic change, and it seems that `common.js` was
introduced by a rogue test and copied and pasted into the rest.
Semver: patch
PR-URL: https://github.com/iojs/io.js/pull/917
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2015-02-22 19:34:17 -08:00
Timothy J Fontaine
ee4b9b552d
test: update our branched weakref to v8 3.24
2014-03-17 10:19:47 -07:00
Timothy J Fontaine
af1418325b
test: backoff client connection rates
...
We were being very aggressive in our connection creations, resulting
in the pipeline flood detection to drop us. Relax how fast we're
creating these connections so the gc can run all its tests.
2014-02-24 11:52:47 -08:00
Timothy J Fontaine
6cc95b06ea
test: refactor to use common testcfg
2014-01-20 09:00:13 -08:00
Ben Noordhuis
0079e575e0
test: fix up weakref.cc after v8 api change
2013-10-23 09:17:32 -07:00
Ben Noordhuis
7684e0b554
test: fix up weakref.cc after v8 api change
2013-07-06 17:44:45 +02:00
Ben Noordhuis
3b0a759b6b
test: fix up weakref.cc after v8 api change
2013-06-12 00:24:41 +02:00
Ben Noordhuis
69572a3965
test: fix up weakref.cc deprecation warnings
2013-05-13 06:46:55 +02:00
Ben Noordhuis
7bfcaa8f91
test: fix up weakref.cc after v8 api change
2013-05-13 06:45:05 +02:00
Ben Noordhuis
dc29d64983
test: fix up weakref.cc after v8 api change
2013-03-20 01:53:34 +01:00
Nathan Rajlich
05fe70b582
test: use the debug build of node-weak when necessary
2012-06-13 17:58:28 -07:00
Nathan Rajlich
c752f6c013
test: add a .gitignore file to ignore weak's compiled "build" dir
2012-06-13 17:58:28 -07:00
Nathan Rajlich
6a8b5b36b4
test: bundle node-weak in test/gc so that it doesn't need to be downloaded
2012-06-14 00:56:35 +02:00
Bert Belder
5209dad907
test-net-timeout: make it pass on Windows
...
The test didn't take into account that some time might pass before
libuv makes close callbacks. This is now fixed.
2012-06-13 02:49:33 +02:00
isaacs
9239088e87
500 is a magic number for the GC for some reason
2012-05-11 15:01:38 -07:00
isaacs
62c12d2161
Clean up gc tests
...
This fixes the additional issues brought up in #3179 .
2012-05-04 10:40:38 -07:00
isaacs
91120e0429
Tests for memory leaks
2012-05-03 10:36:17 -07:00