diff options
author | ZYSzys <zyszys98@gmail.com> | 2019-05-12 15:11:13 +0800 |
---|---|---|
committer | ZYSzys <zyszys98@gmail.com> | 2019-05-13 19:39:34 +0800 |
commit | dcc5e51e1cb4e102effd7fc515681446b07e428e (patch) | |
tree | 63f566515f8150bbe96e63426293bc802c84eb38 /test/common | |
parent | 618fcbd125c386b7bfb37cbc4dce12a694a4ee22 (diff) | |
download | node-new-dcc5e51e1cb4e102effd7fc515681446b07e428e.tar.gz |
tools: force common be required before any other modules
PR-URL: https://github.com/nodejs/node/pull/27650
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'test/common')
-rw-r--r-- | test/common/README.md | 24 | ||||
-rw-r--r-- | test/common/arraystream.js | 2 | ||||
-rw-r--r-- | test/common/benchmark.js | 2 | ||||
-rw-r--r-- | test/common/countdown.js | 2 | ||||
-rw-r--r-- | test/common/dns.js | 2 | ||||
-rw-r--r-- | test/common/duplexpair.js | 2 | ||||
-rw-r--r-- | test/common/fixtures.js | 2 | ||||
-rw-r--r-- | test/common/heap.js | 2 | ||||
-rw-r--r-- | test/common/hijackstdio.js | 2 | ||||
-rw-r--r-- | test/common/http2.js | 2 | ||||
-rw-r--r-- | test/common/index.js | 3 | ||||
-rw-r--r-- | test/common/index.mjs | 2 | ||||
-rw-r--r-- | test/common/internet.js | 2 | ||||
-rw-r--r-- | test/common/report.js | 2 | ||||
-rw-r--r-- | test/common/tls.js | 3 | ||||
-rw-r--r-- | test/common/tmpdir.js | 2 | ||||
-rw-r--r-- | test/common/wpt.js | 2 |
17 files changed, 30 insertions, 28 deletions
diff --git a/test/common/README.md b/test/common/README.md index 391b753f04..664b42aca3 100644 --- a/test/common/README.md +++ b/test/common/README.md @@ -386,7 +386,7 @@ thread. The `ArrayStream` module provides a simple `Stream` that pushes elements from a given array. -<!-- eslint-disable no-undef, node-core/required-modules --> +<!-- eslint-disable no-undef, node-core/require-common-first, node-core/required-modules --> ```js const ArrayStream = require('../common/arraystream'); const stream = new ArrayStream(); @@ -402,7 +402,7 @@ require a particular action to be taken after a given number of completed tasks (for instance, shutting down an HTTP server after a specific number of requests). The Countdown will fail the test if the remainder did not reach 0. -<!-- eslint-disable strict, node-core/required-modules --> +<!-- eslint-disable strict, node-core/require-common-first, node-core/required-modules --> ```js const Countdown = require('../common/countdown'); @@ -574,7 +574,7 @@ one listed below. (`heap.validateSnapshotNodes(...)` is a shortcut for Create a heap dump and an embedder graph copy and validate occurrences. -<!-- eslint-disable no-undef, node-core/required-modules --> +<!-- eslint-disable no-undef, node-core/require-common-first, node-core/required-modules --> ```js validateSnapshotNodes('TLSWRAP', [ { @@ -592,7 +592,7 @@ validateSnapshotNodes('TLSWRAP', [ The `hijackstdio` module provides utility functions for temporarily redirecting `stdout` and `stderr` output. -<!-- eslint-disable no-undef, node-core/required-modules --> +<!-- eslint-disable no-undef, node-core/require-common-first, node-core/required-modules --> ```js const { hijackStdout, restoreStdout } = require('../common/hijackstdio'); @@ -638,7 +638,7 @@ original state after calling [`hijackstdio.hijackStdOut()`][]. The http2.js module provides a handful of utilities for creating mock HTTP/2 frames for testing of HTTP/2 endpoints -<!-- eslint-disable no-unused-vars, node-core/required-modules --> +<!-- eslint-disable no-unused-vars, node-core/require-common-first, node-core/required-modules --> ```js const http2 = require('../common/http2'); ``` @@ -648,7 +648,7 @@ const http2 = require('../common/http2'); The `http2.Frame` is a base class that creates a `Buffer` containing a serialized HTTP/2 frame header. -<!-- eslint-disable no-undef, node-core/required-modules --> +<!-- eslint-disable no-undef, node-core/require-common-first, node-core/required-modules --> ```js // length is a 24-bit unsigned integer // type is an 8-bit unsigned integer identifying the frame type @@ -667,7 +667,7 @@ The serialized `Buffer` may be retrieved using the `frame.data` property. The `http2.DataFrame` is a subclass of `http2.Frame` that serializes a `DATA` frame. -<!-- eslint-disable no-undef, node-core/required-modules --> +<!-- eslint-disable no-undef, node-core/require-common-first, node-core/required-modules --> ```js // id is the 32-bit stream identifier // payload is a Buffer containing the DATA payload @@ -684,7 +684,7 @@ socket.write(frame.data); The `http2.HeadersFrame` is a subclass of `http2.Frame` that serializes a `HEADERS` frame. -<!-- eslint-disable no-undef, node-core/required-modules --> +<!-- eslint-disable no-undef, node-core/require-common-first, node-core/required-modules --> ```js // id is the 32-bit stream identifier // payload is a Buffer containing the HEADERS payload (see either @@ -702,7 +702,7 @@ socket.write(frame.data); The `http2.SettingsFrame` is a subclass of `http2.Frame` that serializes an empty `SETTINGS` frame. -<!-- eslint-disable no-undef, node-core/required-modules --> +<!-- eslint-disable no-undef, node-core/require-common-first, node-core/required-modules --> ```js // ack is a boolean indicating whether or not to set the ACK flag. const frame = new http2.SettingsFrame(ack); @@ -715,7 +715,7 @@ socket.write(frame.data); Set to a `Buffer` instance that contains a minimal set of serialized HTTP/2 request headers to be used as the payload of a `http2.HeadersFrame`. -<!-- eslint-disable no-undef, node-core/required-modules --> +<!-- eslint-disable no-undef, node-core/require-common-first, node-core/required-modules --> ```js const frame = new http2.HeadersFrame(1, http2.kFakeRequestHeaders, 0, true); @@ -727,7 +727,7 @@ socket.write(frame.data); Set to a `Buffer` instance that contains a minimal set of serialized HTTP/2 response headers to be used as the payload a `http2.HeadersFrame`. -<!-- eslint-disable no-undef, node-core/required-modules --> +<!-- eslint-disable no-undef, node-core/require-common-first, node-core/required-modules --> ```js const frame = new http2.HeadersFrame(1, http2.kFakeResponseHeaders, 0, true); @@ -739,7 +739,7 @@ socket.write(frame.data); Set to a `Buffer` containing the preamble bytes an HTTP/2 client must send upon initial establishment of a connection. -<!-- eslint-disable no-undef, node-core/required-modules --> +<!-- eslint-disable no-undef, node-core/require-common-first, node-core/required-modules --> ```js socket.write(http2.kClientMagic); ``` diff --git a/test/common/arraystream.js b/test/common/arraystream.js index 9c497fcd9b..408d57712c 100644 --- a/test/common/arraystream.js +++ b/test/common/arraystream.js @@ -1,4 +1,4 @@ -/* eslint-disable node-core/required-modules */ +/* eslint-disable node-core/require-common-first, node-core/required-modules */ 'use strict'; const { Stream } = require('stream'); diff --git a/test/common/benchmark.js b/test/common/benchmark.js index 0894146c4d..bb182fc688 100644 --- a/test/common/benchmark.js +++ b/test/common/benchmark.js @@ -1,4 +1,4 @@ -/* eslint-disable node-core/required-modules */ +/* eslint-disable node-core/require-common-first, node-core/required-modules */ 'use strict'; diff --git a/test/common/countdown.js b/test/common/countdown.js index 67252657ec..31507b6125 100644 --- a/test/common/countdown.js +++ b/test/common/countdown.js @@ -1,4 +1,4 @@ -/* eslint-disable node-core/required-modules */ +/* eslint-disable node-core/require-common-first, node-core/required-modules */ 'use strict'; diff --git a/test/common/dns.js b/test/common/dns.js index 01245c33d6..37f80dde02 100644 --- a/test/common/dns.js +++ b/test/common/dns.js @@ -1,4 +1,4 @@ -/* eslint-disable node-core/required-modules */ +/* eslint-disable node-core/require-common-first, node-core/required-modules */ 'use strict'; const assert = require('assert'); diff --git a/test/common/duplexpair.js b/test/common/duplexpair.js index fb4faca548..0783aeb861 100644 --- a/test/common/duplexpair.js +++ b/test/common/duplexpair.js @@ -1,4 +1,4 @@ -/* eslint-disable node-core/required-modules */ +/* eslint-disable node-core/require-common-first, node-core/required-modules */ 'use strict'; const { Duplex } = require('stream'); const assert = require('assert'); diff --git a/test/common/fixtures.js b/test/common/fixtures.js index b45e5bc809..2390ee8284 100644 --- a/test/common/fixtures.js +++ b/test/common/fixtures.js @@ -1,4 +1,4 @@ -/* eslint-disable node-core/required-modules */ +/* eslint-disable node-core/require-common-first, node-core/required-modules */ 'use strict'; const path = require('path'); diff --git a/test/common/heap.js b/test/common/heap.js index 97686e05a7..030ea77340 100644 --- a/test/common/heap.js +++ b/test/common/heap.js @@ -1,4 +1,4 @@ -/* eslint-disable node-core/required-modules */ +/* eslint-disable node-core/require-common-first, node-core/required-modules */ 'use strict'; const assert = require('assert'); const util = require('util'); diff --git a/test/common/hijackstdio.js b/test/common/hijackstdio.js index fcc98208f0..6995f66658 100644 --- a/test/common/hijackstdio.js +++ b/test/common/hijackstdio.js @@ -1,4 +1,4 @@ -/* eslint-disable node-core/required-modules */ +/* eslint-disable node-core/require-common-first, node-core/required-modules */ 'use strict'; // Hijack stdout and stderr diff --git a/test/common/http2.js b/test/common/http2.js index f84a668617..c4d430d1d9 100644 --- a/test/common/http2.js +++ b/test/common/http2.js @@ -1,4 +1,4 @@ -/* eslint-disable node-core/required-modules */ +/* eslint-disable node-core/require-common-first, node-core/required-modules */ 'use strict'; // An HTTP/2 testing tool used to create mock frames for direct testing diff --git a/test/common/index.js b/test/common/index.js index 02fe9039dd..3235362166 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -19,7 +19,8 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -/* eslint-disable node-core/required-modules, node-core/crypto-check */ +/* eslint-disable node-core/require-common-first, node-core/required-modules */ +/* eslint-disable node-core/crypto-check */ 'use strict'; const process = global.process; // Some tests tamper with the process global. const path = require('path'); diff --git a/test/common/index.mjs b/test/common/index.mjs index 41592098eb..4758704402 100644 --- a/test/common/index.mjs +++ b/test/common/index.mjs @@ -1,5 +1,5 @@ // Flags: --experimental-modules -/* eslint-disable node-core/required-modules */ +/* eslint-disable node-core/require-common-first, node-core/required-modules */ import { createRequireFromPath } from 'module'; import { fileURLToPath as toPath } from 'url'; diff --git a/test/common/internet.js b/test/common/internet.js index 3880aa114e..88153960f0 100644 --- a/test/common/internet.js +++ b/test/common/internet.js @@ -1,4 +1,4 @@ -/* eslint-disable node-core/required-modules */ +/* eslint-disable node-core/require-common-first, node-core/required-modules */ 'use strict'; // Utilities for internet-related tests diff --git a/test/common/report.js b/test/common/report.js index f97cf10669..163daf286e 100644 --- a/test/common/report.js +++ b/test/common/report.js @@ -1,4 +1,4 @@ -/* eslint-disable node-core/required-modules */ +/* eslint-disable node-core/require-common-first, node-core/required-modules */ 'use strict'; const assert = require('assert'); const fs = require('fs'); diff --git a/test/common/tls.js b/test/common/tls.js index 3560af671b..e7cacde745 100644 --- a/test/common/tls.js +++ b/test/common/tls.js @@ -1,4 +1,5 @@ -/* eslint-disable node-core/required-modules, node-core/crypto-check */ +/* eslint-disable node-core/require-common-first, node-core/required-modules */ +/* eslint-disable node-core/crypto-check */ 'use strict'; const crypto = require('crypto'); diff --git a/test/common/tmpdir.js b/test/common/tmpdir.js index ca761b7f94..369c49019a 100644 --- a/test/common/tmpdir.js +++ b/test/common/tmpdir.js @@ -1,4 +1,4 @@ -/* eslint-disable node-core/required-modules */ +/* eslint-disable node-core/require-common-first, node-core/required-modules */ 'use strict'; const fs = require('fs'); diff --git a/test/common/wpt.js b/test/common/wpt.js index 5592ddfd4a..60be82564b 100644 --- a/test/common/wpt.js +++ b/test/common/wpt.js @@ -1,4 +1,4 @@ -/* eslint-disable node-core/required-modules */ +/* eslint-disable node-core/require-common-first, node-core/required-modules */ 'use strict'; const assert = require('assert'); |