Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
dbdc381
tools: check-imports using utf-8
cclauss Nov 2, 2019
0f9f18a
tools: update certdata.txt
Oct 31, 2019
8c2e2ce
crypto: update root certificates
Oct 31, 2019
2ec40c2
worker: allow specifying resource limits
addaleax Mar 8, 2019
9b11bdb
v8: inspect unserializable objects
addaleax Oct 29, 2019
c2c74fc
encoding: make TextDecoder handle BOM correctly
addaleax Oct 26, 2019
44968f0
src: remove unimplemented method from node.h
addaleax Oct 23, 2019
5f4535a
src: make AtExit() callbacks run in reverse order
addaleax Nov 2, 2019
7b41874
process: make source map getter resistant against prototype tampering
addaleax Nov 2, 2019
e51beef
child_process,cluster: allow using V8 serialization API
addaleax Oct 29, 2019
bb6f944
fs: add noop stub for FSWatcher.prototype.start
lholmquist Oct 29, 2019
fabc489
doc: update examples in writing-tests.md
GaryGSC Oct 25, 2019
c254d74
stream: add writableCorked property
ronag Aug 6, 2019
cd6d621
src: deprecate two- and one-argument AtExit()
addaleax Nov 2, 2019
3727a65
v8: mark serdes API as stable
addaleax Nov 3, 2019
92fa4e0
tools: make doctool work if no internet available
richardlau Nov 2, 2019
0dedecc
test: test configure ninja
Oct 18, 2019
15a7032
doc: move inactive Collaborators to emeriti
Trott Nov 4, 2019
3a44ade
tools: pull xcode_emulation.py from node-gyp
cclauss Nov 5, 2019
e59cc8a
http,async_hooks: keep resource object alive from socket
addaleax Oct 31, 2019
8fe6849
Revert "test: test configure ninja"
addaleax Nov 6, 2019
e3371f0
src: use callback scope for main script
addaleax Nov 3, 2019
0072a8e
src: remove AsyncScope and AsyncCallbackScope
addaleax Nov 3, 2019
8234d04
src: track no of active JS signal handlers
addaleax Nov 2, 2019
cd233e3
src: make EndStartedProfilers an exit hook
addaleax Nov 2, 2019
db7deb6
src: make WaitForInspectorDisconnect an exit hook
addaleax Nov 2, 2019
66b3619
src: use unique_ptr for InitializeInspector()
addaleax Nov 2, 2019
906d279
src: run RunBeforeExitCallbacks as part of EmitBeforeExit
addaleax Nov 2, 2019
0433d79
dgram: reset bind state before emitting error
addaleax Nov 1, 2019
f8ee70c
dgram: remove listeners on bind error
addaleax Nov 1, 2019
31a3b72
doc: update GOVERNANCE.md
Trott Nov 5, 2019
058a8d5
src: do not use `std::function` for `OnScopeLeave`
addaleax Oct 26, 2019
de68720
test: deflake test-tls-close-notify.js
lpinca Nov 1, 2019
b744070
src: allow adding linked bindings to Environment
addaleax Nov 5, 2019
ab5bca3
test: remove AtExit() addon test
addaleax Nov 5, 2019
ae5aa3e
tls: refactor tls_wrap.cc
artmaks Nov 6, 2019
caedcd9
module: fix for empty object in InternalModuleReadJSON
guybedford Nov 5, 2019
bb0727a
test: do not run release-npm test without crypto
targos Nov 5, 2019
bad0b66
tls: replace var with let and const
Nov 6, 2019
a37ade8
http: replace vars with lets and consts in lib/_http_agent.js
Nov 6, 2019
085af30
doc: include --experimental-resolve-self in manpage
guybedford Nov 1, 2019
e98d89c
module: conditional exports with flagged conditions
guybedford Oct 13, 2019
041f3a3
doc: update divergent specifier hazard guidance
GeoffreyBooth Oct 31, 2019
70ad676
src: persist strings that are used multiple times in the environment
bmsdave Nov 6, 2019
88da3af
https: change var to let in lib/https.js
g-prokofyeva Nov 6, 2019
45fd44c
fs: change var to let
nadinTs Nov 6, 2019
b76c13e
assert: replace var with let in lib/assert.js
PerfectPan Nov 5, 2019
6bf0e40
cluster: destruct primordials in lib/internal/cluster/worker.js
peze Nov 4, 2019
293e8a2
esm: exit the process with an error if loader has an issue
targos Nov 2, 2019
9cae205
buffer: change var to let
darky Nov 6, 2019
3e4a6a5
lib: change var to let in lib/_stream_duplex.js
vabole Nov 6, 2019
0f8662d
dns: switch var to const/let
Nov 6, 2019
e363f8e
process: add coverage tests for sourceMapFromDataUrl method
Nov 6, 2019
9248c8b
path: replace var with let in lib/path.js
peze Nov 5, 2019
308f5e4
test: fix test-benchmark-cluster
Trott Nov 9, 2019
2deea28
doc,meta: remove wait period for npm pull requests
Trott Nov 8, 2019
401d2e9
deps: update npm to 6.13.0
ruyadorno Nov 5, 2019
7ad2e02
doc,meta: allow Travis results for doc/comment changes
Trott Nov 8, 2019
ea0c1a6
test: mark test-http-dump-req-when-res-ends as flaky on windows
Nov 6, 2019
aec695e
test: fix Python unittests in ./test and ./tools
cclauss Nov 8, 2019
1133981
doc: add link to node-code-ide-configs in testing
trivikr Nov 1, 2018
7cbdac9
stream: increase MAX_HWM
ronag Oct 20, 2019
b8aceac
http: http_incoming rename var to let and const
Nov 6, 2019
9230fff
net: replaced vars to lets and consts
alexahdp Nov 6, 2019
50f9476
http: http_common rename var to let and const
Nov 6, 2019
9a1c16e
lib: replaced var to let in lib/v8.js
bmsdave Nov 6, 2019
26a9bdf
tls: replace var with let
dividead Nov 6, 2019
3d8cdf1
esm: unflag --experimental-modules
guybedford Oct 11, 2019
b558d94
doc: fix some recent doc nits
vsemozhetbyt Nov 9, 2019
b8afe57
doc: fix up N-API doc
mhdawson Nov 4, 2019
cd82e4d
test: replace Object.assign with object spread
Nov 6, 2019
1836eae
doc, console: remove non-existant methods from docs
SimonSchick Nov 10, 2019
c832565
doc: add lookup to http.request() options
lpinca Nov 10, 2019
642b0b8
tools: update tzdata to 2019c
albertyw Nov 10, 2019
41720d7
stream: add writableCorked to Duplex
addaleax Nov 13, 2019
62e15a7
http: outgoing cork
ronag Aug 8, 2019
39d0a25
crypto: fix key requirements in asymmetric cipher
tniessen Nov 4, 2019
2d16a74
doc: remove "maintenance is supported by" text in BUILDING.md
Trott Nov 12, 2019
1e26720
doc: remove "multiple variants" from BUILDING.md
Trott Nov 12, 2019
64cf00b
doc: simplify text in pull-requests.md
Trott Nov 13, 2019
72bbd5c
test: change var to const in parallel/test-stream-transform-final*
khoumani Nov 12, 2019
e4a296c
doc: add entry to url.parse() changes metadata
lpinca Nov 10, 2019
109da52
test: deflake test-http-dump-req-when-res-ends.js
lpinca Nov 11, 2019
d37d340
lib: change var to let in string_decoder
Nov 12, 2019
7e603be
doc: createRequire can take import.meta.url directly
GeoffreyBooth Nov 15, 2019
3b45f8f
url: replace var with let in lib/url.js
xefimx Nov 6, 2019
d631a0a
doc: update 8.x to 10.x in backporting guide
GaryGSC Nov 14, 2019
b590533
doc: esm: improve dual package hazard docs
GeoffreyBooth Nov 9, 2019
f9eab48
esm: disable non-js exts outside package scopes
guybedford Nov 15, 2019
a93345b
doc: update outdated commonjs compat info
GeoffreyBooth Nov 17, 2019
3ce6e15
lib: replace var with let/const
khoumani Nov 12, 2019
35dc848
util: replace var with let
ssncferreira Nov 12, 2019
0130d2b
benchmark: use let instead of var in assert
dnlup Nov 12, 2019
5869f2b
tls: change loop var to let
Xavier-Redondo Nov 12, 2019
c40e242
doc: replace const / var with let
duncanhealy Nov 12, 2019
13a2243
test: var to const in test-repl-multiline.js
soulmonk Nov 12, 2019
fa071ef
test: changed var to const in test
bassgeta Nov 12, 2019
89bc252
test: change var to let
nath1as Nov 12, 2019
d648c93
src: lib/internal/timers.js var -> let/const
nikolaykrashnikov Nov 6, 2019
0d12e9c
test: improve test-fs-open
artmaks Nov 6, 2019
f4f210a
build: store cache on timed out builds on Travis
richardlau Nov 13, 2019
fba2f9a
doc: document timed out Travis CI builds
richardlau Nov 13, 2019
592d51c
src: enhance feature access `CHECK`s during bootstrap
addaleax Nov 12, 2019
4524c7a
stream: replace var with let
daern91 Nov 12, 2019
13bac0a
test: changed var to let in test-repl-editor
jlPhillips-rms Nov 12, 2019
5ec550d
test: Change from var to const
Nov 12, 2019
183464a
querystring: replace var with let/const
Nov 12, 2019
f106086
lib: change var to let in internal/streams
Nov 12, 2019
7f49816
benchmark: use let instead of var in async_hooks
dnlup Nov 13, 2019
b82f63d
deps: update nghttp2 to 1.40.0
gengjiawen Nov 15, 2019
7f664e4
doc: adds NO_COLOR to assert doc page
shobhitchittora Nov 14, 2019
c464ede
test: handle undefined default_configuration
codebytere Nov 13, 2019
2c8276e
src: expose ability to set options
codebytere Nov 13, 2019
4fe62c1
http: revise _http_server.js
Nov 6, 2019
80b1717
tools: fix build at non-English windows
pd4d10 Nov 15, 2019
3eeeea4
lib: change var to let/const in internal/querystring.js
artmaks Nov 6, 2019
66e1adf
net: destructure primordials
Nov 12, 2019
c7c5660
module: reduce circular dependency of internal/modules/cjs/loader
joyeecheung Nov 10, 2019
605cb9f
deps: update V8 to 7.9.317.22
targos Nov 17, 2019
b5198cd
build: reset embedder string to "-node.0"
targos Nov 17, 2019
6018db2
deps: V8: un-cherry-pick bd019bd
refack Mar 27, 2019
6566c15
deps: V8: silence irrelevant warnings
targos Mar 27, 2019
4182e3b
deps: patch V8 to run on older XCode versions
ryzokuken Sep 14, 2019
a4a6565
deps: update V8's postmortem script
cjihrig Sep 27, 2019
13e6b0b
deps: update V8's postmortem script
cjihrig Oct 15, 2019
627a804
deps: V8: patch register-arm64.h
refack May 22, 2019
5bc3573
deps: V8: forward declaration of `Rtl*FunctionTable`
refack May 22, 2019
4638361
deps: make v8.h compatible with VS2015
joaocgreis Nov 1, 2019
2abdcbb
deps: V8: cherry-pick f2d92ec
targos Oct 18, 2019
ba4abfd
deps: V8: cherry-pick 3e82c8d
targos Oct 21, 2019
28ca44c
deps: V8: cherry-pick cfe9172
targos Oct 21, 2019
ebef1b2
deps: V8: cherry-pick bba5f1f
targos Oct 24, 2019
4c7acc2
deps: V8: cherry-pick 6b0a953
targos Oct 24, 2019
824e8b6
deps: V8: cherry-pick 7228ef8
targos Oct 24, 2019
5131bbe
deps: V8: cherry-pick 777fa98
targos Oct 28, 2019
fe99841
deps: V8: backport 07ee86a5a28b
targos Oct 23, 2019
9c356ba
deps: V8: backport 5e755c6ee6d3
targos Oct 31, 2019
1e5e8c3
deps: V8: cherry-pick e5dbc95
Oct 30, 2019
2c6cf90
deps: V8: cherry-pick 50031fae736f
targos Nov 4, 2019
5a1ad57
deps: V8: cherry-pick a7dffcd767be
cclauss Nov 3, 2019
277e5fa
build,tools: update V8 gypfiles for V8 7.9
targos Sep 11, 2019
4131b14
test: update test-postmortem-metadata.js
cjihrig Oct 15, 2019
f0ff2ed
src: update v8abbr.h for V8 update
cjihrig Oct 15, 2019
2952c5d
test: increase limit again for network space overhead test
targos Oct 23, 2019
0d5de1a
src: remove custom tracking for SharedArrayBuffers
addaleax Oct 22, 2019
f17c794
deps: patch V8 to be API/ABI compatible with 7.8 (from 7.9)
targos Nov 17, 2019
1a92c88
src: migrate off ArrayBuffer::GetContents
addaleax Nov 8, 2019
a2dbadc
src: introduce custom smart pointers for `BaseObject`s
addaleax Sep 28, 2019
6665881
http2: use custom BaseObject smart pointers
addaleax Sep 28, 2019
940a297
src: use BaseObjectPtr for keeping channel alive in dns bindings
addaleax Nov 12, 2019
4222f24
src: remove keep alive option from SetImmediate()
addaleax Nov 12, 2019
564c18e
src: remove HandleWrap instances from list once closed
addaleax Oct 11, 2019
2e43686
src: mark ArrayBuffers with free callbacks as untransferable
addaleax Nov 13, 2019
21dd601
src: expose ArrayBuffer version of Buffer::New()
addaleax Nov 13, 2019
b775753
doc: update http.md mention of socket
jessekoconnor Oct 28, 2019
966404f
src: add file name to 'Module did not self-register' error
nornagon Oct 25, 2019
f25b00a
https: add client support for TLS keylog events
sam-github Oct 21, 2019
31a63ab
lib: replace var with let and const in readline.js
VinceOPS Nov 12, 2019
f15a3b0
lib: replace var with let
Nov 12, 2019
01fa18c
tls: cli option to enable TLS key logging to file
sam-github Oct 22, 2019
18ec8a8
crypto: add support for IEEE-P1363 DSA signatures
tniessen Aug 20, 2019
7188b95
src: fix -Winconsistent-missing-override warning
cjihrig Nov 19, 2019
6be0398
test: clean up http-set-trailers
lundibundi Nov 18, 2019
9b71534
deps: upgrade npm to 6.13.1
claudiahdz Nov 18, 2019
027bde5
doc: fix overriding of prefix option
lpinca Nov 17, 2019
9940116
doc: explain GIT_REMOTE_REF in COLLABORATOR_GUIDE
lundibundi Nov 12, 2019
ab887bd
doc: add mention for using promisify on class methods
lundibundi Nov 10, 2019
45e5730
test: add test for options validation of createServer
ZYSzys Nov 19, 2019
1b84175
http2: remove duplicated assertIsObject
ZYSzys Nov 19, 2019
7e0f90e
domain: rename var to let and const
marystogova Nov 6, 2019
a5f25ec
test: cover 'close' method in Dir class
artmaks Nov 6, 2019
92f766b
test: improve assertion message in internet dgram test
Trott Nov 19, 2019
902c670
test: use reserved .invalid TLD for invalid address in test
Trott Nov 19, 2019
cb9c64a
test: move test not requiring internet from internet to parallel
Trott Nov 19, 2019
4f282f5
deps: patch V8 to 7.9.317.23
MylesBorins Nov 20, 2019
8eda60c
2019-11-21, Version 13.2.0 (Current)
MylesBorins Nov 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
doc: update examples in writing-tests.md
`writing-tests.md` states to use arrow functions when appropriate.
This updates the examples to do that.

Further, this syncs the docs with what's found in
[`test/parallel/test-http-agent-null.js`](https://github.com/nodejs/node/blob/master/test/parallel/test-http-agent-null.js)

PR-URL: #30126
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
  • Loading branch information
GaryGSC authored and MylesBorins committed Nov 17, 2019
commit fabc489dba208dd511f0806d139dffda684a335c
17 changes: 10 additions & 7 deletions doc/guides/writing-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,19 +162,22 @@ const assert = require('assert');
const http = require('http');

let request = 0;
let listening = 0;
let response = 0;
process.on('exit', function() {
process.on('exit', () => {
assert.equal(request, 1, 'http server "request" callback was not called');
assert.equal(listening, 1, 'http server "listening" callback was not called');
assert.equal(response, 1, 'http request "response" callback was not called');
});

const server = http.createServer((req, res) => {
request++;
res.end();
}).listen(0, function() {
}).listen(0, () => {
listening++;
const options = {
agent: null,
port: this.address().port
port: server.address().port
};
http.get(options, (res) => {
response++;
Expand All @@ -193,16 +196,16 @@ const http = require('http');

const server = http.createServer(common.mustCall((req, res) => {
res.end();
})).listen(0, function() {
})).listen(0, common.mustCall(() => {
const options = {
agent: null,
port: this.address().port
port: server.address().port
};
http.get(options, common.mustCall((res) => {
res.resume();
server.close();
}));
});
}));

```

Expand All @@ -216,7 +219,7 @@ shutting down an HTTP server after a specific number of requests).
```javascript
const Countdown = require('../common/countdown');

const countdown = new Countdown(2, function() {
const countdown = new Countdown(2, () => {
console.log('.');
});

Expand Down