Skip to content

Commit 9bade7a

Browse files
Trottgibfahn
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 Backport-PR-URL: #17768 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 9830b10 commit 9bade7a

File tree

1 file changed

+48
-46
lines changed

1 file changed

+48
-46
lines changed

test/common/README.md

Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ A stream to push an array into a REPL
4242

4343
Blocks for `time` amount of time.
4444

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

5254
### crashOnUnhandledRejection()
5355

@@ -62,9 +64,9 @@ failures.
6264
Platform normalizes the `dd` command
6365

6466
### enoughTestMem
65-
* return [&lt;Boolean>]
67+
* [&lt;Boolean>]
6668

67-
Check if there is more than 1gb of total memory.
69+
Indicates if there is more than 1gb of total memory.
6870

6971
### expectsError([fn, ]settings[, exact])
7072
* `fn` [&lt;Function>] a function that should throw.
@@ -137,39 +139,39 @@ Returns an instance of all possible `ArrayBufferView`s of the provided Buffer.
137139
Returns the file name and line number for the provided Function.
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

0 commit comments

Comments
 (0)