mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
doc: lowercase primitives in test/common/README.md
PR-URL: https://github.com/nodejs/node/pull/18875 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
1 parent
c943cd09a7
commit
951054004d
1 file changed
+78
-78
+78
-78
@@ -21,7 +21,7 @@ The `benchmark` module is used by tests to run benchmarks.
|
||||
|
||||
### runBenchmark(name, args, env)
|
||||
|
||||
* `name` [<String>] Name of benchmark suite to be run.
|
||||
* `name` [<string>] Name of benchmark suite to be run.
|
||||
* `args` [<Array>] Array of environment variable key/value pairs (ex:
|
||||
`n=1`) to be applied via `--set`.
|
||||
* `env` [<Object>] Environment variables to be applied during the run.
|
||||
@@ -41,12 +41,12 @@ Takes `whitelist` and concats that with predefined `knownGlobals`.
|
||||
A stream to push an array into a REPL
|
||||
|
||||
### busyLoop(time)
|
||||
* `time` [<Number>]
|
||||
* `time` [<number>]
|
||||
|
||||
Blocks for `time` amount of time.
|
||||
|
||||
### canCreateSymLink()
|
||||
* return [<Boolean>]
|
||||
* 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
|
||||
@@ -67,7 +67,7 @@ failures.
|
||||
Platform normalizes the `dd` command
|
||||
|
||||
### enoughTestMem
|
||||
* [<Boolean>]
|
||||
* [<boolean>]
|
||||
|
||||
Indicates if there is more than 1gb of total memory.
|
||||
|
||||
@@ -76,17 +76,17 @@ Indicates if there is more than 1gb of total memory.
|
||||
* `settings` [<Object>]
|
||||
that must contain the `code` property plus any of the other following
|
||||
properties (some properties only apply for `AssertionError`):
|
||||
* `code` [<String>]
|
||||
* `code` [<string>]
|
||||
expected error must have this value for its `code` property.
|
||||
* `type` [<Function>]
|
||||
expected error must be an instance of `type` and must be an Error subclass.
|
||||
* `message` [<String>] or [<RegExp>]
|
||||
* `message` [<string>] or [<RegExp>]
|
||||
if a string is provided for `message`, expected error must have it for its
|
||||
`message` property; if a regular expression is provided for `message`, the
|
||||
regular expression must match the `message` property of the expected error.
|
||||
* `name` [<String>]
|
||||
* `name` [<string>]
|
||||
expected error must have this value for its `name` property.
|
||||
* `generatedMessage` [<String>]
|
||||
* `generatedMessage` [<string>]
|
||||
(`AssertionError` only) expected error must have this value for its
|
||||
`generatedMessage` property.
|
||||
* `actual` <any>
|
||||
@@ -98,7 +98,7 @@ Indicates if there is more than 1gb of total memory.
|
||||
* `operator` <any>
|
||||
(`AssertionError` only) expected error must have this value for its
|
||||
`operator` property.
|
||||
* `exact` [<Number>] default = 1
|
||||
* `exact` [<number>] default = 1
|
||||
* return [<Function>]
|
||||
|
||||
If `fn` is provided, it will be passed to `assert.throws` as first argument
|
||||
@@ -109,14 +109,14 @@ Indicates if there is more than 1gb of total memory.
|
||||
test is complete, then the test will fail.
|
||||
|
||||
### expectWarning(name, expected)
|
||||
* `name` [<String>]
|
||||
* `expected` [<String>] | [<Array>]
|
||||
* `name` [<string>]
|
||||
* `expected` [<string>] | [<Array>]
|
||||
|
||||
Tests whether `name` and `expected` are part of a raised warning.
|
||||
|
||||
### fileExists(pathname)
|
||||
* pathname [<String>]
|
||||
* return [<Boolean>]
|
||||
* pathname [<string>]
|
||||
* return [<boolean>]
|
||||
|
||||
Checks if `pathname` exists
|
||||
|
||||
@@ -135,42 +135,42 @@ consisting of all `ArrayBufferView` and an `ArrayBuffer`.
|
||||
|
||||
### getCallSite(func)
|
||||
* `func` [<Function>]
|
||||
* return [<String>]
|
||||
* return [<string>]
|
||||
|
||||
Returns the file name and line number for the provided Function.
|
||||
|
||||
### globalCheck
|
||||
* [<Boolean>]
|
||||
* [<boolean>]
|
||||
|
||||
Set to `false` if the test should not check for global leaks.
|
||||
|
||||
### hasCrypto
|
||||
* [<Boolean>]
|
||||
* [<boolean>]
|
||||
|
||||
Indicates whether OpenSSL is available.
|
||||
|
||||
### hasFipsCrypto
|
||||
* [<Boolean>]
|
||||
* [<boolean>]
|
||||
|
||||
Indicates `hasCrypto` and `crypto` with fips.
|
||||
|
||||
### hasIntl
|
||||
* [<Boolean>]
|
||||
* [<boolean>]
|
||||
|
||||
Indicates if [internationalization] is supported.
|
||||
|
||||
### hasSmallICU
|
||||
* [<Boolean>]
|
||||
* [<boolean>]
|
||||
|
||||
Indicates `hasIntl` and `small-icu` are supported.
|
||||
|
||||
### hasIPv6
|
||||
* [<Boolean>]
|
||||
* [<boolean>]
|
||||
|
||||
Indicates whether `IPv6` is supported on this platform.
|
||||
|
||||
### hasMultiLocalhost
|
||||
* [<Boolean>]
|
||||
* [<boolean>]
|
||||
|
||||
Indicates if there are multiple localhosts available.
|
||||
|
||||
@@ -193,58 +193,58 @@ be passed to `listener`. What's more, `process.stdout.writeTimes` is a count of
|
||||
the number of calls.
|
||||
|
||||
### inFreeBSDJail
|
||||
* [<Boolean>]
|
||||
* [<boolean>]
|
||||
|
||||
Checks whether free BSD Jail is true or false.
|
||||
|
||||
### isAIX
|
||||
* [<Boolean>]
|
||||
* [<boolean>]
|
||||
|
||||
Platform check for Advanced Interactive eXecutive (AIX).
|
||||
|
||||
### isAlive(pid)
|
||||
* `pid` [<Number>]
|
||||
* return [<Boolean>]
|
||||
* `pid` [<number>]
|
||||
* return [<boolean>]
|
||||
|
||||
Attempts to 'kill' `pid`
|
||||
|
||||
### isFreeBSD
|
||||
* [<Boolean>]
|
||||
* [<boolean>]
|
||||
|
||||
Platform check for Free BSD.
|
||||
|
||||
### isLinux
|
||||
* [<Boolean>]
|
||||
* [<boolean>]
|
||||
|
||||
Platform check for Linux.
|
||||
|
||||
### isLinuxPPCBE
|
||||
* [<Boolean>]
|
||||
* [<boolean>]
|
||||
|
||||
Platform check for Linux on PowerPC.
|
||||
|
||||
### isOSX
|
||||
* [<Boolean>]
|
||||
* [<boolean>]
|
||||
|
||||
Platform check for macOS.
|
||||
|
||||
### isSunOS
|
||||
* [<Boolean>]
|
||||
* [<boolean>]
|
||||
|
||||
Platform check for SunOS.
|
||||
|
||||
### isWindows
|
||||
* [<Boolean>]
|
||||
* [<boolean>]
|
||||
|
||||
Platform check for Windows.
|
||||
|
||||
### isWOW64
|
||||
* [<Boolean>]
|
||||
* [<boolean>]
|
||||
|
||||
Platform check for Windows 32-bit on Windows 64-bit.
|
||||
|
||||
### isCPPSymbolsNotMapped
|
||||
* [<Boolean>]
|
||||
* [<boolean>]
|
||||
|
||||
Platform check for C++ symbols are mapped or not.
|
||||
|
||||
@@ -254,7 +254,7 @@ Platform check for C++ symbols are mapped or not.
|
||||
Indicates whether any globals are not on the `knownGlobals` list.
|
||||
|
||||
### localhostIPv4
|
||||
* [<String>]
|
||||
* [<string>]
|
||||
|
||||
IP of `localhost`.
|
||||
|
||||
@@ -265,7 +265,7 @@ Array of IPV6 representations for `localhost`.
|
||||
|
||||
### mustCall([fn][, exact])
|
||||
* `fn` [<Function>] default = () => {}
|
||||
* `exact` [<Number>] default = 1
|
||||
* `exact` [<number>] default = 1
|
||||
* return [<Function>]
|
||||
|
||||
Returns a function that calls `fn`. If the returned function has not been called
|
||||
@@ -276,7 +276,7 @@ If `fn` is not provided, an empty function will be used.
|
||||
|
||||
### mustCallAsync([fn][, exact])
|
||||
* `fn` [<Function>]
|
||||
* `exact` [<Number>] default = 1
|
||||
* `exact` [<number>] default = 1
|
||||
* return [<Function>]
|
||||
|
||||
The same as `mustCall()`, except that it is also checked that the Promise
|
||||
@@ -287,7 +287,7 @@ function, if necessary wrapped as a promise.
|
||||
|
||||
### mustCallAtLeast([fn][, minimum])
|
||||
* `fn` [<Function>] default = () => {}
|
||||
* `minimum` [<Number>] default = 1
|
||||
* `minimum` [<number>] default = 1
|
||||
* return [<Function>]
|
||||
|
||||
Returns a function that calls `fn`. If the returned function has not been called
|
||||
@@ -297,44 +297,44 @@ fail.
|
||||
If `fn` is not provided, an empty function will be used.
|
||||
|
||||
### mustNotCall([msg])
|
||||
* `msg` [<String>] default = 'function should not have been called'
|
||||
* `msg` [<string>] default = 'function should not have been called'
|
||||
* return [<Function>]
|
||||
|
||||
Returns a function that triggers an `AssertionError` if it is invoked. `msg` is
|
||||
used as the error message for the `AssertionError`.
|
||||
|
||||
### nodeProcessAborted(exitCode, signal)
|
||||
* `exitCode` [<Number>]
|
||||
* `signal` [<String>]
|
||||
* return [<Boolean>]
|
||||
* `exitCode` [<number>]
|
||||
* `signal` [<string>]
|
||||
* return [<boolean>]
|
||||
|
||||
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.
|
||||
|
||||
### opensslCli
|
||||
* [<Boolean>]
|
||||
* [<boolean>]
|
||||
|
||||
Indicates whether 'opensslCli' is supported.
|
||||
|
||||
### platformTimeout(ms)
|
||||
* `ms` [<Number>]
|
||||
* return [<Number>]
|
||||
* `ms` [<number>]
|
||||
* return [<number>]
|
||||
|
||||
Platform normalizes timeout.
|
||||
|
||||
### PIPE
|
||||
* [<String>]
|
||||
* [<string>]
|
||||
|
||||
Path to the test socket.
|
||||
|
||||
### PORT
|
||||
* [<Number>]
|
||||
* [<number>]
|
||||
|
||||
A port number for tests to use if one is needed.
|
||||
|
||||
### printSkipMessage(msg)
|
||||
* `msg` [<String>]
|
||||
* `msg` [<string>]
|
||||
|
||||
Logs '1..0 # Skipped: ' + `msg`
|
||||
|
||||
@@ -349,7 +349,7 @@ Restore the original `process.stdout.write`. Used to restore `stdout` to its
|
||||
original state after calling [`common.hijackStdOut()`][].
|
||||
|
||||
### rootDir
|
||||
* [<String>]
|
||||
* [<string>]
|
||||
|
||||
Path to the 'root' directory. either `/` or `c:\\` (windows)
|
||||
|
||||
@@ -359,7 +359,7 @@ Path to the 'root' directory. either `/` or `c:\\` (windows)
|
||||
Path to the project directory.
|
||||
|
||||
### skip(msg)
|
||||
* `msg` [<String>]
|
||||
* `msg` [<string>]
|
||||
|
||||
Logs '1..0 # Skipped: ' + `msg` and exits with exit code `0`.
|
||||
|
||||
@@ -432,8 +432,8 @@ The `DNS` module provides utilities related to the `dns` built-in module.
|
||||
|
||||
### errorLookupMock(code, syscall)
|
||||
|
||||
* `code` [<String>] Defaults to `dns.mockedErrorCode`.
|
||||
* `syscall` [<String>] Defaults to `dns.mockedSysCall`.
|
||||
* `code` [<string>] Defaults to `dns.mockedErrorCode`.
|
||||
* `syscall` [<string>] Defaults to `dns.mockedSysCall`.
|
||||
* return [<Function>]
|
||||
|
||||
A mock for the `lookup` option of `net.connect()` that would result in an error
|
||||
@@ -451,7 +451,7 @@ The default `syscall` of errors generated by `errorLookupMock`.
|
||||
### readDomainFromPacket(buffer, offset)
|
||||
|
||||
* `buffer` [<Buffer>]
|
||||
* `offset` [<Number>]
|
||||
* `offset` [<number>]
|
||||
* return [<Object>]
|
||||
|
||||
Reads the domain string from a packet and returns an object containing the
|
||||
@@ -467,14 +467,14 @@ the packet depending on the type of packet.
|
||||
|
||||
### writeIPv6(ip)
|
||||
|
||||
* `ip` [<String>]
|
||||
* `ip` [<string>]
|
||||
* return [<Buffer>]
|
||||
|
||||
Reads an IPv6 String and returns a Buffer containing the parts.
|
||||
|
||||
### writeDomainName(domain)
|
||||
|
||||
* `domain` [<String>]
|
||||
* `domain` [<string>]
|
||||
* return [<Buffer>]
|
||||
|
||||
Reads a Domain String and returns a Buffer containing the domain.
|
||||
@@ -502,26 +502,26 @@ files in the `test/fixtures` directory.
|
||||
|
||||
### fixtures.fixturesDir
|
||||
|
||||
* [<String>]
|
||||
* [<string>]
|
||||
|
||||
The absolute path to the `test/fixtures/` directory.
|
||||
|
||||
### fixtures.path(...args)
|
||||
|
||||
* `...args` [<String>]
|
||||
* `...args` [<string>]
|
||||
|
||||
Returns the result of `path.join(fixtures.fixturesDir, ...args)`.
|
||||
|
||||
### fixtures.readSync(args[, enc])
|
||||
|
||||
* `args` [<String>] | [<Array>]
|
||||
* `args` [<string>] | [<Array>]
|
||||
|
||||
Returns the result of
|
||||
`fs.readFileSync(path.join(fixtures.fixturesDir, ...args), 'enc')`.
|
||||
|
||||
### fixtures.readKey(arg[, enc])
|
||||
|
||||
* `arg` [<String>]
|
||||
* `arg` [<string>]
|
||||
|
||||
Returns the result of
|
||||
`fs.readFileSync(path.join(fixtures.fixturesDir, 'keys', arg), 'enc')`.
|
||||
@@ -645,26 +645,26 @@ internet-related tests.
|
||||
### internet.addresses
|
||||
|
||||
* [<Object>]
|
||||
* `INET_HOST` [<String>] A generic host that has registered common
|
||||
* `INET_HOST` [<string>] A generic host that has registered common
|
||||
DNS records, supports both IPv4 and IPv6, and provides basic HTTP/HTTPS
|
||||
services
|
||||
* `INET4_HOST` [<String>] A host that provides IPv4 services
|
||||
* `INET6_HOST` [<String>] A host that provides IPv6 services
|
||||
* `INET4_IP` [<String>] An accessible IPv4 IP, defaults to the
|
||||
* `INET4_HOST` [<string>] A host that provides IPv4 services
|
||||
* `INET6_HOST` [<string>] A host that provides IPv6 services
|
||||
* `INET4_IP` [<string>] An accessible IPv4 IP, defaults to the
|
||||
Google Public DNS IPv4 address
|
||||
* `INET6_IP` [<String>] An accessible IPv6 IP, defaults to the
|
||||
* `INET6_IP` [<string>] An accessible IPv6 IP, defaults to the
|
||||
Google Public DNS IPv6 address
|
||||
* `INVALID_HOST` [<String>] An invalid host that cannot be resolved
|
||||
* `MX_HOST` [<String>] A host with MX records registered
|
||||
* `SRV_HOST` [<String>] A host with SRV records registered
|
||||
* `PTR_HOST` [<String>] A host with PTR records registered
|
||||
* `NAPTR_HOST` [<String>] A host with NAPTR records registered
|
||||
* `SOA_HOST` [<String>] A host with SOA records registered
|
||||
* `CNAME_HOST` [<String>] A host with CNAME records registered
|
||||
* `NS_HOST` [<String>] A host with NS records registered
|
||||
* `TXT_HOST` [<String>] A host with TXT records registered
|
||||
* `DNS4_SERVER` [<String>] An accessible IPv4 DNS server
|
||||
* `DNS6_SERVER` [<String>] An accessible IPv6 DNS server
|
||||
* `INVALID_HOST` [<string>] An invalid host that cannot be resolved
|
||||
* `MX_HOST` [<string>] A host with MX records registered
|
||||
* `SRV_HOST` [<string>] A host with SRV records registered
|
||||
* `PTR_HOST` [<string>] A host with PTR records registered
|
||||
* `NAPTR_HOST` [<string>] A host with NAPTR records registered
|
||||
* `SOA_HOST` [<string>] A host with SOA records registered
|
||||
* `CNAME_HOST` [<string>] A host with CNAME records registered
|
||||
* `NS_HOST` [<string>] A host with NS records registered
|
||||
* `TXT_HOST` [<string>] A host with TXT records registered
|
||||
* `DNS4_SERVER` [<string>] An accessible IPv4 DNS server
|
||||
* `DNS6_SERVER` [<string>] An accessible IPv6 DNS server
|
||||
|
||||
A set of addresses for internet-related tests. All properties are configurable
|
||||
via `NODE_TEST_*` environment variables. For example, to configure
|
||||
@@ -676,7 +676,7 @@ variable `NODE_TEST_INET_HOST` to a specified host.
|
||||
The `tmpdir` module supports the use of a temporary directory for testing.
|
||||
|
||||
### path
|
||||
* [<String>]
|
||||
* [<string>]
|
||||
|
||||
The realpath of the testing temporary directory.
|
||||
|
||||
@@ -696,13 +696,13 @@ implementation with tests from
|
||||
|
||||
[<Array>]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
|
||||
[<ArrayBufferView[]>]: https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView
|
||||
[<Boolean>]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type
|
||||
[<Buffer>]: https://nodejs.org/api/buffer.html#buffer_class_buffer
|
||||
[<Function>]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function
|
||||
[<Number>]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type
|
||||
[<Object>]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object
|
||||
[<RegExp>]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp
|
||||
[<String>]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type
|
||||
[<boolean>]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type
|
||||
[<number>]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type
|
||||
[<string>]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type
|
||||
[`common.hijackStdErr()`]: #hijackstderrlistener
|
||||
[`common.hijackStdOut()`]: #hijackstdoutlistener
|
||||
[internationalization]: https://github.com/nodejs/node/wiki/Intl
|
||||
Reference in new issue
Block a user