This folder contains code and data used to test the Node.js implementation.
For a detailed guide on how to write tests in this directory, see the guide on writing tests.
On how to run tests in this direcotry, see the contributing guide.
The common.js module is used by tests for consistency across repeated tasks. It has a number of helpful functions and properties to help with writing tests.
Takes whitelist and concats that with predefined knownGlobals.
A stream to push an array into a REPL
time<Number>
Blocks for time amount of time.
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). On non-Windows platforms, this currently returns true.
- return <Object>
Platform normalizes the dd command
- return <Boolean>
Check if there is more than 1gb of total memory.
-
settings<Object> with the following optional properties:code<String> expected error must have this value for itscodepropertytype<Function> expected error must be an instance oftypemessage<String> or <RegExp> if a string is provided formessage, expected error must have it for itsmessageproperty; if a regular expression is provided formessage, the regular expression must match themessageproperty of the expected error
-
return function suitable for use as a validation function passed as the second argument to
assert.throws()
The expected error should be subclassed by the internal/errors module.
Tests whether name and expected are part of a raised warning.
- return <Boolean>
Checks for 'openssl'.
- return <Boolean>
Checks hasCrypto and crypto with fips.
- return <Boolean>
Checks whether IPv6 is supported on this platform.
- return <Boolean>
Checks if there are multiple localhosts available.
Throws an AssertionError with msg
Checks if pathname exists
- return <String>
Path to the 'fixtures' directory.
- return <Boolean>
Turn this off if the test should not check for global leaks.
- return <Boolean>
Checks whether free BSD Jail is true or false.
- return <Boolean>
Platform check for Advanced Interactive eXecutive (AIX).
Attempts to 'kill' pid
- return <Boolean>
Platform check for Free BSD.
- return <Boolean>
Platform check for Linux.
- return <Boolean>
Platform check for Linux on PowerPC.
- return <Boolean>
Platform check for OS X.
- return <Boolean>
Platform check for SunOS.
- return <Boolean>
Platform check for Windows.
- return <Boolean>
Platform check for Windows 32-bit on Windows 64-bit.
- return <Array>
Checks whether any globals are not on the knownGlobals list.
- return <String>
Gets IP of localhost
- return <Array>
Array of IPV6 hosts.
- fn <Function>
- expected <Number> default = 1
- return <Function>
Returns a function that calls fn. If the returned function has not been called
exactly expected number of times when the test is complete, then the test will
fail.
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.
- return <Boolean>
Checks whether 'opensslCli' is supported.
Platform normalizes timeout.
- return <String>
Path to the test sock.
- return <Number> default =
12346
Port tests are running on.
- return <String>
Deletes the 'tmp' dir and recreates it
- return <String>
Path to the 'root' directory. either / or c:\\ (windows)
msg<String>
Logs '1..0 # Skipped: ' + msg
Platform normalizes the cat command.
Platform normalizes the pwd command.
Synchronous version of spawnCat.
Synchronous version of spawnPwd.
- return <String>
The realpath of the 'tmp' directory.
- return <String>
Name of the temp directory used by tests.
A port of parts of W3C testharness.js for testing the Node.js WHATWG URL API implementation with tests from W3C Web Platform Tests.
