From 339d220eedf2149c8f66a2a397bc6dddf43b4be5 Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Fri, 2 Jun 2017 19:30:25 -0700 Subject: [PATCH] test: rearrange inspector headers into convention Test guide describes a conventional layout for test headers, review inspector tests and reorganize to follow the convention. PR-URL: https://github.com/nodejs/node/pull/13428 Reviewed-By: Refael Ackermann Reviewed-By: Colin Ihrig Reviewed-By: Gibson Fahnestock Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- test/inspector/test-inspector-debug-brk.js | 2 ++ test/inspector/test-inspector-ip-detection.js | 1 + test/inspector/test-inspector-port-zero-cluster.js | 3 ++- test/inspector/test-inspector-port-zero.js | 3 ++- test/inspector/test-inspector-stops-no-file.js | 1 + test/inspector/test-inspector.js | 2 ++ test/parallel/test-cluster-inspector-debug-port.js | 2 ++ test/parallel/test-inspector-invalid-args.js | 7 ++++--- 8 files changed, 16 insertions(+), 5 deletions(-) diff --git a/test/inspector/test-inspector-debug-brk.js b/test/inspector/test-inspector-debug-brk.js index a5cb77250de439..27c9c5fdbc328d 100644 --- a/test/inspector/test-inspector-debug-brk.js +++ b/test/inspector/test-inspector-debug-brk.js @@ -1,6 +1,8 @@ 'use strict'; const common = require('../common'); + common.skipIfInspectorDisabled(); + const assert = require('assert'); const helper = require('./inspector-helper.js'); diff --git a/test/inspector/test-inspector-ip-detection.js b/test/inspector/test-inspector-ip-detection.js index d2d60411894ca8..ad51c631645e4a 100644 --- a/test/inspector/test-inspector-ip-detection.js +++ b/test/inspector/test-inspector-ip-detection.js @@ -1,5 +1,6 @@ 'use strict'; const common = require('../common'); + common.skipIfInspectorDisabled(); const assert = require('assert'); diff --git a/test/inspector/test-inspector-port-zero-cluster.js b/test/inspector/test-inspector-port-zero-cluster.js index 45282c9d2e66cc..4582b4bb38657b 100644 --- a/test/inspector/test-inspector-port-zero-cluster.js +++ b/test/inspector/test-inspector-port-zero-cluster.js @@ -1,8 +1,9 @@ // Flags: --inspect=0 'use strict'; - const common = require('../common'); + common.skipIfInspectorDisabled(); + const assert = require('assert'); const cluster = require('cluster'); diff --git a/test/inspector/test-inspector-port-zero.js b/test/inspector/test-inspector-port-zero.js index 182dd50dd4dea9..0776c8226530e9 100644 --- a/test/inspector/test-inspector-port-zero.js +++ b/test/inspector/test-inspector-port-zero.js @@ -1,7 +1,8 @@ 'use strict'; - const { mustCall, skipIfInspectorDisabled } = require('../common'); + skipIfInspectorDisabled(); + const assert = require('assert'); const { URL } = require('url'); const { spawn } = require('child_process'); diff --git a/test/inspector/test-inspector-stops-no-file.js b/test/inspector/test-inspector-stops-no-file.js index d0f3a753464096..772063b279f5af 100644 --- a/test/inspector/test-inspector-stops-no-file.js +++ b/test/inspector/test-inspector-stops-no-file.js @@ -1,5 +1,6 @@ 'use strict'; require('../common'); + const spawn = require('child_process').spawn; const child = spawn(process.execPath, diff --git a/test/inspector/test-inspector.js b/test/inspector/test-inspector.js index 9d6bb563e1190a..19eb3601f0fbc7 100644 --- a/test/inspector/test-inspector.js +++ b/test/inspector/test-inspector.js @@ -1,6 +1,8 @@ 'use strict'; const common = require('../common'); + common.skipIfInspectorDisabled(); + const assert = require('assert'); const helper = require('./inspector-helper.js'); diff --git a/test/parallel/test-cluster-inspector-debug-port.js b/test/parallel/test-cluster-inspector-debug-port.js index 2b214c4ad26bd8..a049da78be0f70 100644 --- a/test/parallel/test-cluster-inspector-debug-port.js +++ b/test/parallel/test-cluster-inspector-debug-port.js @@ -1,7 +1,9 @@ 'use strict'; // Flags: --inspect={PORT} const common = require('../common'); + common.skipIfInspectorDisabled(); + const assert = require('assert'); const cluster = require('cluster'); const debuggerPort = common.PORT; diff --git a/test/parallel/test-inspector-invalid-args.js b/test/parallel/test-inspector-invalid-args.js index 6e249470230abb..80473a568cacd8 100644 --- a/test/parallel/test-inspector-invalid-args.js +++ b/test/parallel/test-inspector-invalid-args.js @@ -1,11 +1,12 @@ 'use strict'; +const common = require('../common'); + +common.skipIfInspectorDisabled(); + const assert = require('assert'); const execFile = require('child_process').execFile; const path = require('path'); -const common = require('../common'); -common.skipIfInspectorDisabled(); - const mainScript = path.join(common.fixturesDir, 'loop.js'); const expected = '`node --debug` and `node --debug-brk` are invalid. ' +