Skip to content

Commit 0093840

Browse files
TrottMylesBorins
authored andcommitted
test,doc: do not indicate that non-functions "return" values
Update documentation for test `common` module so that properties that are not functions do not specify a return type and functions that do return values specify the type. PR-URL: #17267 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent e00923b commit 0093840

File tree

1 file changed

+49
-48
lines changed

1 file changed

+49
-48
lines changed

test/common/README.md

+49-48
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,14 @@ A stream to push an array into a REPL
4343

4444
Blocks for `time` amount of time.
4545

46-
### canCreateSymLink
47-
API to indicate whether the current running process can create
48-
symlinks. On Windows, this returns false if the process running
49-
doesn't have privileges to create symlinks (specifically
50-
[SeCreateSymbolicLinkPrivilege](https://msdn.microsoft.com/en-us/library/windows/desktop/bb530716(v=vs.85).aspx)).
51-
On non-Windows platforms, this currently returns true.
46+
### canCreateSymLink()
47+
* return [&lt;Boolean>]
48+
49+
Checks whether the current running process can create symlinks. On Windows, this
50+
returns `false` if the process running doesn't have privileges to create
51+
symlinks
52+
([SeCreateSymbolicLinkPrivilege](https://msdn.microsoft.com/en-us/library/windows/desktop/bb530716(v=vs.85).aspx)).
53+
On non-Windows platforms, this always returns `true`.
5254

5355
### crashOnUnhandledRejection()
5456

@@ -63,9 +65,9 @@ failures.
6365
Platform normalizes the `dd` command
6466

6567
### enoughTestMem
66-
* return [&lt;Boolean>]
68+
* [&lt;Boolean>]
6769

68-
Check if there is more than 1gb of total memory.
70+
Indicates if there is more than 1gb of total memory.
6971

7072
### expectsError([fn, ]settings[, exact])
7173
* `fn` [&lt;Function>] a function that should throw.
@@ -126,7 +128,7 @@ that happens within the `timeoutMs` timespan, or rejects with `error` as
126128
a reason otherwise.
127129

128130
### fixturesDir
129-
* return [&lt;String>]
131+
* [&lt;String>]
130132

131133
Path to the 'fixtures' directory.
132134

@@ -137,39 +139,39 @@ Path to the 'fixtures' directory.
137139
Returns an instance of all possible `ArrayBufferView`s of the provided Buffer.
138140

139141
### globalCheck
140-
* return [&lt;Boolean>]
142+
* [&lt;Boolean>]
141143

142-
Turn this off if the test should not check for global leaks.
144+
Set to `false` if the test should not check for global leaks.
143145

144146
### hasCrypto
145-
* return [&lt;Boolean>]
147+
* [&lt;Boolean>]
146148

147-
Checks for 'openssl'.
149+
Indicates whether OpenSSL is available.
148150

149151
### hasFipsCrypto
150-
* return [&lt;Boolean>]
152+
* [&lt;Boolean>]
151153

152-
Checks `hasCrypto` and `crypto` with fips.
154+
Indicates `hasCrypto` and `crypto` with fips.
153155

154156
### hasIntl
155-
* return [&lt;Boolean>]
157+
* [&lt;Boolean>]
156158

157-
Checks if [internationalization] is supported.
159+
Indicates if [internationalization] is supported.
158160

159161
### hasSmallICU
160-
* return [&lt;Boolean>]
162+
* [&lt;Boolean>]
161163

162-
Checks `hasIntl` and `small-icu` is supported.
164+
Indicates `hasIntl` and `small-icu` are supported.
163165

164166
### hasIPv6
165-
* return [&lt;Boolean>]
167+
* [&lt;Boolean>]
166168

167-
Checks whether `IPv6` is supported on this platform.
169+
Indicates whether `IPv6` is supported on this platform.
168170

169171
### hasMultiLocalhost
170-
* return [&lt;Boolean>]
172+
* [&lt;Boolean>]
171173

172-
Checks if there are multiple localhosts available.
174+
Indicates if there are multiple localhosts available.
173175

174176
### hijackStderr(listener)
175177
* `listener` [&lt;Function>]: a listener with a single parameter
@@ -190,12 +192,12 @@ be passed to `listener`. What's more, `process.stdout.writeTimes` is a count of
190192
the number of calls.
191193

192194
### inFreeBSDJail
193-
* return [&lt;Boolean>]
195+
* [&lt;Boolean>]
194196

195197
Checks whether free BSD Jail is true or false.
196198

197199
### isAIX
198-
* return [&lt;Boolean>]
200+
* [&lt;Boolean>]
199201

200202
Platform check for Advanced Interactive eXecutive (AIX).
201203

@@ -206,54 +208,54 @@ Platform check for Advanced Interactive eXecutive (AIX).
206208
Attempts to 'kill' `pid`
207209

208210
### isFreeBSD
209-
* return [&lt;Boolean>]
211+
* [&lt;Boolean>]
210212

211213
Platform check for Free BSD.
212214

213215
### isLinux
214-
* return [&lt;Boolean>]
216+
* [&lt;Boolean>]
215217

216218
Platform check for Linux.
217219

218220
### isLinuxPPCBE
219-
* return [&lt;Boolean>]
221+
* [&lt;Boolean>]
220222

221223
Platform check for Linux on PowerPC.
222224

223225
### isOSX
224-
* return [&lt;Boolean>]
226+
* [&lt;Boolean>]
225227

226228
Platform check for macOS.
227229

228230
### isSunOS
229-
* return [&lt;Boolean>]
231+
* [&lt;Boolean>]
230232

231233
Platform check for SunOS.
232234

233235
### isWindows
234-
* return [&lt;Boolean>]
236+
* [&lt;Boolean>]
235237

236238
Platform check for Windows.
237239

238240
### isWOW64
239-
* return [&lt;Boolean>]
241+
* [&lt;Boolean>]
240242

241243
Platform check for Windows 32-bit on Windows 64-bit.
242244

243-
### leakedGlobals
245+
### leakedGlobals()
244246
* return [&lt;Array>]
245247

246-
Checks whether any globals are not on the `knownGlobals` list.
248+
Indicates whether any globals are not on the `knownGlobals` list.
247249

248250
### localhostIPv4
249-
* return [&lt;String>]
251+
* [&lt;String>]
250252

251-
Gets IP of localhost
253+
IP of `localhost`.
252254

253255
### localIPv6Hosts
254-
* return [&lt;Array>]
256+
* [&lt;Array>]
255257

256-
Array of IPV6 hosts.
258+
Array of IPV6 representations for `localhost`.
257259

258260
### mustCall([fn][, exact])
259261
* `fn` [&lt;Function>] default = () => {}
@@ -294,9 +296,9 @@ the exit code and/or signal name of a node process that aborted, `false`
294296
otherwise.
295297

296298
### opensslCli
297-
* return [&lt;Boolean>]
299+
* [&lt;Boolean>]
298300

299-
Checks whether 'opensslCli' is supported.
301+
Indicates whether 'opensslCli' is supported.
300302

301303
### platformTimeout(ms)
302304
* `ms` [&lt;Number>]
@@ -305,14 +307,14 @@ Checks whether 'opensslCli' is supported.
305307
Platform normalizes timeout.
306308

307309
### PIPE
308-
* return [&lt;String>]
310+
* [&lt;String>]
309311

310-
Path to the test sock.
312+
Path to the test socket.
311313

312314
### PORT
313-
* return [&lt;Number>] default = `12346`
315+
* [&lt;Number>]
314316

315-
Port tests are running on.
317+
A port number for tests to use if one is needed.
316318

317319
### printSkipMessage(msg)
318320
* `msg` [&lt;String>]
@@ -335,12 +337,12 @@ Restore the original `process.stdout.write`. Used to restore `stdout` to its
335337
original state after calling [`common.hijackStdOut()`][].
336338

337339
### rootDir
338-
* return [&lt;String>]
340+
* [&lt;String>]
339341

340342
Path to the 'root' directory. either `/` or `c:\\` (windows)
341343

342344
### projectDir
343-
* return [&lt;String>]
345+
* [&lt;String>]
344346

345347
Path to the project directory.
346348

@@ -372,7 +374,7 @@ Platform normalizes the `pwd` command.
372374
Synchronous version of `spawnPwd`.
373375

374376
### tmpDir
375-
* return [&lt;String>]
377+
* [&lt;String>]
376378

377379
The realpath of the 'tmp' directory.
378380

@@ -422,7 +424,6 @@ The `DNS` module provides utilities related to the `dns` built-in module.
422424
* `syscall` [&lt;String>] Defaults to `dns.mockedSysCall`.
423425
* return [&lt;Function>]
424426

425-
426427
A mock for the `lookup` option of `net.connect()` that would result in an error
427428
with the `code` and the `syscall` specified. Returns a function that has the
428429
same signature as `dns.lookup()`.

0 commit comments

Comments
 (0)