Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test,doc: do not indicate that non-functions "return" values #17267

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
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
97 changes: 49 additions & 48 deletions test/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ A stream to push an array into a REPL

Blocks for `time` amount of time.

### canCreateSymLink
API to indicate whether the current running process can create
symlinks. On Windows, this returns false if the process running
doesn't have privileges to create symlinks (specifically
[SeCreateSymbolicLinkPrivilege](https://msdn.microsoft.com/en-us/library/windows/desktop/bb530716(v=vs.85).aspx)).
On non-Windows platforms, this currently returns true.
### canCreateSymLink()
* return [<Boolean>]

Checks whether the current running process can create symlinks. On Windows, this
returns `false` if the process running doesn't have privileges to create
symlinks
([SeCreateSymbolicLinkPrivilege](https://msdn.microsoft.com/en-us/library/windows/desktop/bb530716(v=vs.85).aspx)).
On non-Windows platforms, this always returns `true`.

### crashOnUnhandledRejection()

Expand All @@ -63,9 +65,9 @@ failures.
Platform normalizes the `dd` command

### enoughTestMem
* return [<Boolean>]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't we losing information here (type of the property)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll follow the convention in our docs and restore these lines but remove the word return.

* [<Boolean>]

Check if there is more than 1gb of total memory.
Indicates if there is more than 1gb of total memory.

### expectsError([fn, ]settings[, exact])
* `fn` [<Function>] a function that should throw.
Expand Down Expand Up @@ -126,7 +128,7 @@ that happens within the `timeoutMs` timespan, or rejects with `error` as
a reason otherwise.

### fixturesDir
* return [<String>]
* [<String>]

Path to the 'fixtures' directory.

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

### globalCheck
* return [<Boolean>]
* [<Boolean>]

Turn this off if the test should not check for global leaks.
Set to `false` if the test should not check for global leaks.

### hasCrypto
* return [<Boolean>]
* [<Boolean>]

Checks for 'openssl'.
Indicates whether OpenSSL is available.

### hasFipsCrypto
* return [<Boolean>]
* [<Boolean>]

Checks `hasCrypto` and `crypto` with fips.
Indicates `hasCrypto` and `crypto` with fips.

### hasIntl
* return [<Boolean>]
* [<Boolean>]

Checks if [internationalization] is supported.
Indicates if [internationalization] is supported.

### hasSmallICU
* return [<Boolean>]
* [<Boolean>]

Checks `hasIntl` and `small-icu` is supported.
Indicates `hasIntl` and `small-icu` are supported.

### hasIPv6
* return [<Boolean>]
* [<Boolean>]

Checks whether `IPv6` is supported on this platform.
Indicates whether `IPv6` is supported on this platform.

### hasMultiLocalhost
* return [<Boolean>]
* [<Boolean>]

Checks if there are multiple localhosts available.
Indicates if there are multiple localhosts available.

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

### inFreeBSDJail
* return [<Boolean>]
* [<Boolean>]

Checks whether free BSD Jail is true or false.

### isAIX
* return [<Boolean>]
* [<Boolean>]

Platform check for Advanced Interactive eXecutive (AIX).

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

### isFreeBSD
* return [<Boolean>]
* [<Boolean>]

Platform check for Free BSD.

### isLinux
* return [<Boolean>]
* [<Boolean>]

Platform check for Linux.

### isLinuxPPCBE
* return [<Boolean>]
* [<Boolean>]

Platform check for Linux on PowerPC.

### isOSX
* return [<Boolean>]
* [<Boolean>]

Platform check for macOS.

### isSunOS
* return [<Boolean>]
* [<Boolean>]

Platform check for SunOS.

### isWindows
* return [<Boolean>]
* [<Boolean>]

Platform check for Windows.

### isWOW64
* return [<Boolean>]
* [<Boolean>]

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

### leakedGlobals
### leakedGlobals()
* return [<Array>]

Checks whether any globals are not on the `knownGlobals` list.
Indicates whether any globals are not on the `knownGlobals` list.

### localhostIPv4
* return [<String>]
* [<String>]

Gets IP of localhost
IP of `localhost`.

### localIPv6Hosts
* return [<Array>]
* [<Array>]

Array of IPV6 hosts.
Array of IPV6 representations for `localhost`.

### mustCall([fn][, exact])
* `fn` [<Function>] default = () => {}
Expand Down Expand Up @@ -294,9 +296,9 @@ the exit code and/or signal name of a node process that aborted, `false`
otherwise.

### opensslCli
* return [<Boolean>]
* [<Boolean>]

Checks whether 'opensslCli' is supported.
Indicates whether 'opensslCli' is supported.

### platformTimeout(ms)
* `ms` [<Number>]
Expand All @@ -305,14 +307,14 @@ Checks whether 'opensslCli' is supported.
Platform normalizes timeout.

### PIPE
* return [<String>]
* [<String>]

Path to the test sock.
Path to the test socket.

### PORT
* return [<Number>] default = `12346`
* [<Number>]

Port tests are running on.
A port number for tests to use if one is needed.

### printSkipMessage(msg)
* `msg` [<String>]
Expand All @@ -335,12 +337,12 @@ Restore the original `process.stdout.write`. Used to restore `stdout` to its
original state after calling [`common.hijackStdOut()`][].

### rootDir
* return [<String>]
* [<String>]

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

### projectDir
* return [<String>]
* [<String>]

Path to the project directory.

Expand Down Expand Up @@ -372,7 +374,7 @@ Platform normalizes the `pwd` command.
Synchronous version of `spawnPwd`.

### tmpDir
* return [<String>]
* [<String>]

The realpath of the 'tmp' directory.

Expand Down Expand Up @@ -422,7 +424,6 @@ The `DNS` module provides utilities related to the `dns` built-in module.
* `syscall` [<String>] Defaults to `dns.mockedSysCall`.
* return [<Function>]


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