summaryrefslogtreecommitdiff
path: root/test/common/README.md
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2018-08-21 14:47:47 -0700
committerJames M Snell <jasnell@gmail.com>2018-08-23 16:51:56 -0700
commitfa543c00cdaca6a6c68d1df4c68c061e2b82ca21 (patch)
tree5fec72f5c739129a75ec1588fa1e0face32a5cf6 /test/common/README.md
parent2d64a51270f20e47de663fd45326a93dda1694e4 (diff)
downloadandroid-node-v8-fa543c00cdaca6a6c68d1df4c68c061e2b82ca21.tar.gz
android-node-v8-fa543c00cdaca6a6c68d1df4c68c061e2b82ca21.tar.bz2
android-node-v8-fa543c00cdaca6a6c68d1df4c68c061e2b82ca21.zip
test: move common.ArrayStream to separate module
In a continuing effort to de-monolithize `require('../common')`, move `common.ArrayStream` out to a separate module that is imported only when it is needed. PR-URL: https://github.com/nodejs/node/pull/22447 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'test/common/README.md')
-rw-r--r--test/common/README.md17
1 files changed, 14 insertions, 3 deletions
diff --git a/test/common/README.md b/test/common/README.md
index 27634c97e1..e44dcd299c 100644
--- a/test/common/README.md
+++ b/test/common/README.md
@@ -38,9 +38,6 @@ tasks.
Takes `whitelist` and concats that with predefined `knownGlobals`.
-### arrayStream
-A stream to push an array into a REPL
-
### busyLoop(time)
* `time` [&lt;number>]
@@ -413,6 +410,20 @@ Platform normalizes the `pwd` command.
Synchronous version of `spawnPwd`.
+## ArrayStream Module
+
+The `ArrayStream` module provides a simple `Stream` that pushes elements from
+a given array.
+
+<!-- eslint-disable no-undef, node-core/required-modules -->
+```js
+const ArrayStream = require('../common/arraystream');
+const stream = new ArrayStream();
+stream.run(['a', 'b', 'c']);
+```
+
+It can be used within tests as a simple mock stream.
+
## Countdown Module
The `Countdown` module provides a simple countdown mechanism for tests that