@@ -13,16 +13,16 @@ The `common` module is used by tests for consistency across repeated
1313tasks.
1414
1515### allowGlobals(...whitelist)
16- * ` whitelist ` [ < ; Array>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array ) Array of Globals
17- * return [ < ; Array>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array )
16+ * ` whitelist ` [ < ; Array>] Array of Globals
17+ * return [ < ; Array>]
1818
1919Takes ` whitelist ` and concats that with predefined ` knownGlobals ` .
2020
2121### arrayStream
2222A stream to push an array into a REPL
2323
2424### busyLoop(time)
25- * ` time ` [ < ; Number>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type )
25+ * ` time ` [ < ; Number>]
2626
2727Blocks for ` time ` amount of time.
2828
@@ -41,183 +41,185 @@ no unexpected rejections occur, because currently they result in silent
4141failures.
4242
4343### ddCommand(filename, kilobytes)
44- * return [ < ; Object>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object )
44+ * return [ < ; Object>]
4545
4646Platform normalizes the ` dd ` command
4747
4848### enoughTestMem
49- * return [ < ; Boolean>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type )
49+ * return [ < ; Boolean>]
5050
5151Check if there is more than 1gb of total memory.
5252
5353### expectsError([ fn, ] settings[ , exact] )
54- * ` fn ` [ < ; Function>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function )
55- * ` settings ` [ < ; Object>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object )
54+ * ` fn ` [ < ; Function>]
55+ * ` settings ` [ < ; Object>]
5656 with the following optional properties:
57- * ` code ` [ < ; String>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type )
57+ * ` code ` [ < ; String>]
5858 expected error must have this value for its ` code ` property
59- * ` type ` [ < ; Function>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function )
59+ * ` type ` [ < ; Function>]
6060 expected error must be an instance of ` type `
61- * ` message ` [ < ; String>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type )
62- or [ < ; RegExp>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp )
61+ * ` message ` [ < ; String>]
62+ or [ < ; RegExp>]
6363 if a string is provided for ` message ` , expected error must have it for its
6464 ` message ` property; if a regular expression is provided for ` message ` , the
6565 regular expression must match the ` message ` property of the expected error
66- * ` exact ` [ < ; Number>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type ) default = 1
66+ * ` exact ` [ < ; Number>] default = 1
6767
6868* return function suitable for use as a validation function passed as the second
69- argument to e.g. ` assert.throws() ` . If the returned function has not been called
70- exactly ` exact ` number of times when the test is complete, then the test will
71- fail.
69+ argument to e.g. ` assert.throws() ` . If the returned function has not been
70+ called exactly ` exact ` number of times when the test is complete, then the
71+ test will fail.
7272
7373If ` fn ` is provided, it will be passed to ` assert.throws ` as first argument.
7474
7575The expected error should be [ subclassed by the ` internal/errors ` module] ( https://github.com/nodejs/node/blob/master/doc/guides/using-internal-errors.md#api ) .
7676
7777### expectWarning(name, expected)
78- * ` name ` [ < ; String>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type )
79- * ` expected ` [ < ; String>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type ) | [ < ; Array>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array )
78+ * ` name ` [ < ; String>]
79+ * ` expected ` [ < ; String>] | [ < ; Array>]
8080
8181Tests whether ` name ` and ` expected ` are part of a raised warning.
8282
8383### fileExists(pathname)
84- * pathname [ < ; String>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type )
85- * return [ < ; Boolean>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type )
84+ * pathname [ < ; String>]
85+ * return [ < ; Boolean>]
8686
8787Checks if ` pathname ` exists
8888
8989### fixturesDir
90- * return [ < ; String>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type )
90+ * return [ < ; String>]
9191
9292Path to the 'fixtures' directory.
9393
9494### getArrayBufferViews(buf)
95- * ` buf ` [ < ; Buffer>] ( https://nodejs.org/api/buffer.html#buffer_class_buffer )
96- * return [ < ; ArrayBufferView[ ;] ; >] ( https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView )
95+ * ` buf ` [ < ; Buffer>]
96+ * return [ < ; ArrayBufferView[ ;] ; >]
9797
9898Returns an instance of all possible ` ArrayBufferView ` s of the provided Buffer.
9999
100100### globalCheck
101- * return [ < ; Boolean>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type )
101+ * return [ < ; Boolean>]
102102
103103Turn this off if the test should not check for global leaks.
104104
105105### hasCrypto
106- * return [ < ; Boolean>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type )
106+ * return [ < ; Boolean>]
107107
108108Checks for 'openssl'.
109109
110110### hasFipsCrypto
111- * return [ < ; Boolean>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type )
111+ * return [ < ; Boolean>]
112112
113113Checks ` hasCrypto ` and ` crypto ` with fips.
114114
115115### hasIntl
116- * return [ < ; Boolean>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type )
116+ * return [ < ; Boolean>]
117117
118118Checks if [ internationalization] is supported.
119119
120120### hasSmallICU
121- * return [ < ; Boolean>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type )
121+ * return [ < ; Boolean>]
122122
123123Checks ` hasIntl ` and ` small-icu ` is supported.
124124
125125### hasIPv6
126- * return [ < ; Boolean>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type )
126+ * return [ < ; Boolean>]
127127
128128Checks whether ` IPv6 ` is supported on this platform.
129129
130130### hasMultiLocalhost
131- * return [ < ; Boolean>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type )
131+ * return [ < ; Boolean>]
132132
133133Checks if there are multiple localhosts available.
134134
135135### hijackStderr(listener)
136- * ` listener ` [ < ; Function>] [ MDN-Function ] : a listener with a single parameter called ` data ` .
136+ * ` listener ` [ < ; Function>] : a listener with a single parameter
137+ called ` data ` .
137138
138139Eavesdrop to ` process.stderr.write ` calls. Once ` process.stderr.write ` is
139140called, ` listener ` will also be called and the ` data ` of ` write ` function will
140141be passed to ` listener ` . What's more, ` process.stderr.writeTimes ` is a count of
141142the number of calls.
142143
143144### hijackStdout(listener)
144- * ` listener ` [ < ; Function>] [ MDN-Function ] : a listener with a single parameter called ` data ` .
145+ * ` listener ` [ < ; Function>] : a listener with a single parameter
146+ called ` data ` .
145147
146148Eavesdrop to ` process.stdout.write ` calls. Once ` process.stdout.write ` is
147149called, ` listener ` will also be called and the ` data ` of ` write ` function will
148150be passed to ` listener ` . What's more, ` process.stdout.writeTimes ` is a count of
149151the number of calls.
150152
151153### inFreeBSDJail
152- * return [ < ; Boolean>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type )
154+ * return [ < ; Boolean>]
153155
154156Checks whether free BSD Jail is true or false.
155157
156158### isAix
157- * return [ < ; Boolean>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type )
159+ * return [ < ; Boolean>]
158160
159161Platform check for Advanced Interactive eXecutive (AIX).
160162
161163### isAlive(pid)
162- * ` pid ` [ < ; Number>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type )
163- * return [ < ; Boolean>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type )
164+ * ` pid ` [ < ; Number>]
165+ * return [ < ; Boolean>]
164166
165167Attempts to 'kill' ` pid `
166168
167169### isFreeBSD
168- * return [ < ; Boolean>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type )
170+ * return [ < ; Boolean>]
169171
170172Platform check for Free BSD.
171173
172174### isLinux
173- * return [ < ; Boolean>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type )
175+ * return [ < ; Boolean>]
174176
175177Platform check for Linux.
176178
177179### isLinuxPPCBE
178- * return [ < ; Boolean>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type )
180+ * return [ < ; Boolean>]
179181
180182Platform check for Linux on PowerPC.
181183
182184### isOSX
183- * return [ < ; Boolean>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type )
185+ * return [ < ; Boolean>]
184186
185187Platform check for macOS.
186188
187189### isSunOS
188- * return [ < ; Boolean>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type )
190+ * return [ < ; Boolean>]
189191
190192Platform check for SunOS.
191193
192194### isWindows
193- * return [ < ; Boolean>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type )
195+ * return [ < ; Boolean>]
194196
195197Platform check for Windows.
196198
197199### isWOW64
198- * return [ < ; Boolean>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type )
200+ * return [ < ; Boolean>]
199201
200202Platform check for Windows 32-bit on Windows 64-bit.
201203
202204### leakedGlobals
203- * return [ < ; Array>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array )
205+ * return [ < ; Array>]
204206
205207Checks whether any globals are not on the ` knownGlobals ` list.
206208
207209### localhostIPv4
208- * return [ < ; String>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type )
210+ * return [ < ; String>]
209211
210212Gets IP of localhost
211213
212214### localIPv6Hosts
213- * return [ < ; Array>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array )
215+ * return [ < ; Array>]
214216
215217Array of IPV6 hosts.
216218
217219### mustCall([ fn] [ , exact ] )
218- * ` fn ` [ < ; Function>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function ) default = () => {}
219- * ` exact ` [ < ; Number>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type ) default = 1
220- * return [ < ; Function>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function )
220+ * ` fn ` [ < ; Function>] default = () => {}
221+ * ` exact ` [ < ; Number>] default = 1
222+ * return [ < ; Function>]
221223
222224Returns a function that calls ` fn ` . If the returned function has not been called
223225exactly ` exact ` number of times when the test is complete, then the test will
@@ -226,9 +228,9 @@ fail.
226228If ` fn ` is not provided, an empty function will be used.
227229
228230### mustCallAtLeast([ fn] [ , minimum ] )
229- * ` fn ` [ < ; Function>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function ) default = () => {}
230- * ` minimum ` [ < ; Number>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type ) default = 1
231- * return [ < ; Function>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function )
231+ * ` fn ` [ < ; Function>] default = () => {}
232+ * ` minimum ` [ < ; Number>] default = 1
233+ * return [ < ; Function>]
232234
233235Returns a function that calls ` fn ` . If the returned function has not been called
234236at least ` minimum ` number of times when the test is complete, then the test will
@@ -237,46 +239,49 @@ fail.
237239If ` fn ` is not provided, an empty function will be used.
238240
239241### mustNotCall([ msg] )
240- * ` msg ` [ < ; String>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type ) default = 'function should not have been called'
241- * return [ < ; Function>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function )
242+ * ` msg ` [ < ; String>] default = 'function should not have been called'
243+ * return [ < ; Function>]
242244
243- Returns a function that triggers an ` AssertionError ` if it is invoked. ` msg ` is used as the error message for the ` AssertionError ` .
245+ Returns a function that triggers an ` AssertionError ` if it is invoked. ` msg ` is
246+ used as the error message for the ` AssertionError ` .
244247
245248### nodeProcessAborted(exitCode, signal)
246- * ` exitCode ` [ < ; Number>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type )
247- * ` signal ` [ < ; String>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type )
248- * return [ < ; Boolean>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type )
249+ * ` exitCode ` [ < ; Number>]
250+ * ` signal ` [ < ; String>]
251+ * return [ < ; Boolean>]
249252
250- Returns ` true ` if the exit code ` exitCode ` and/or signal name ` signal ` represent the exit code and/or signal name of a node process that aborted, ` false ` otherwise.
253+ Returns ` true ` if the exit code ` exitCode ` and/or signal name ` signal ` represent
254+ the exit code and/or signal name of a node process that aborted, ` false `
255+ otherwise.
251256
252257### opensslCli
253- * return [ < ; Boolean>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type )
258+ * return [ < ; Boolean>]
254259
255260Checks whether 'opensslCli' is supported.
256261
257262### platformTimeout(ms)
258- * ` ms ` [ < ; Number>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type )
259- * return [ < ; Number>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type )
263+ * ` ms ` [ < ; Number>]
264+ * return [ < ; Number>]
260265
261266Platform normalizes timeout.
262267
263268### PIPE
264- * return [ < ; String>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type )
269+ * return [ < ; String>]
265270
266271Path to the test sock.
267272
268273### PORT
269- * return [ < ; Number>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type ) default = ` 12346 `
274+ * return [ < ; Number>] default = ` 12346 `
270275
271276Port tests are running on.
272277
273278### printSkipMessage(msg)
274- * ` msg ` [ < ; String>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type )
279+ * ` msg ` [ < ; String>]
275280
276281Logs '1..0 # Skipped: ' + ` msg `
277282
278283### refreshTmpDir
279- * return [ < ; String>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type )
284+ * return [ < ; String>]
280285
281286Deletes the 'tmp' dir and recreates it
282287
@@ -289,34 +294,34 @@ Restore the original `process.stderr.write`.
289294Restore the original ` process.stdout.write ` .
290295
291296### rootDir
292- * return [ < ; String>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type )
297+ * return [ < ; String>]
293298
294299Path to the 'root' directory. either ` / ` or ` c:\\ ` (windows)
295300
296301### skip(msg)
297- * ` msg ` [ < ; String>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type )
302+ * ` msg ` [ < ; String>]
298303
299304Logs '1..0 # Skipped: ' + ` msg ` and exits with exit code ` 0 ` .
300305
301306### spawnPwd(options)
302- * ` options ` [ < ; Object>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object )
303- * return [ < ; Object>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object )
307+ * ` options ` [ < ; Object>]
308+ * return [ < ; Object>]
304309
305310Platform normalizes the ` pwd ` command.
306311
307312### spawnSyncPwd(options)
308- * ` options ` [ < ; Object>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object )
309- * return [ < ; Object>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object )
313+ * ` options ` [ < ; Object>]
314+ * return [ < ; Object>]
310315
311316Synchronous version of ` spawnPwd ` .
312317
313318### tmpDir
314- * return [ < ; String>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type )
319+ * return [ < ; String>]
315320
316321The realpath of the 'tmp' directory.
317322
318323### tmpDirName
319- * return [ < ; String>] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type )
324+ * return [ < ; String>]
320325
321326Name of the temp directory used by tests.
322327
@@ -329,5 +334,13 @@ Node.js
329334implementation with tests from
330335[ W3C Web Platform Tests] ( https://github.com/w3c/web-platform-tests ) .
331336
332- [ MDN-Function ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Normal_objects_and_functions
337+ [ < ; Array>] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
338+ [ < ; ArrayBufferView[ ;] ; >] : https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView
339+ [ < ; Boolean>] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type
340+ [ < ; Buffer>] : https://nodejs.org/api/buffer.html#buffer_class_buffer
341+ [ < ; Function>] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function
342+ [ < ; Number>] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type
343+ [ < ; Object>] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object
344+ [ < ; RegExp>] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp
345+ [ < ; String>] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type
333346[ internationalization ] : https://github.com/nodejs/node/wiki/Intl
0 commit comments