xref: /third_party/node/test/parallel/test-inspector-invalid-args.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ciconst common = require('../common');
31cb0ef41Sopenharmony_ciconst fixtures = require('../common/fixtures');
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_cicommon.skipIfInspectorDisabled();
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ciconst assert = require('assert');
81cb0ef41Sopenharmony_ciconst execFile = require('child_process').execFile;
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_ciconst mainScript = fixtures.path('loop.js');
111cb0ef41Sopenharmony_ciconst expected =
121cb0ef41Sopenharmony_ci  '`node --debug` and `node --debug-brk` are invalid. ' +
131cb0ef41Sopenharmony_ci  'Please use `node --inspect` and `node --inspect-brk` instead.';
141cb0ef41Sopenharmony_cifor (const invalidArg of ['--debug-brk', '--debug']) {
151cb0ef41Sopenharmony_ci  execFile(
161cb0ef41Sopenharmony_ci    process.execPath,
171cb0ef41Sopenharmony_ci    [invalidArg, mainScript],
181cb0ef41Sopenharmony_ci    common.mustCall((error, stdout, stderr) => {
191cb0ef41Sopenharmony_ci      assert.strictEqual(error.code, 9, `node ${invalidArg} should exit 9`);
201cb0ef41Sopenharmony_ci      assert.strictEqual(
211cb0ef41Sopenharmony_ci        stderr.includes(expected),
221cb0ef41Sopenharmony_ci        true,
231cb0ef41Sopenharmony_ci        `${stderr} should include '${expected}'`
241cb0ef41Sopenharmony_ci      );
251cb0ef41Sopenharmony_ci    })
261cb0ef41Sopenharmony_ci  );
271cb0ef41Sopenharmony_ci}
28

Indexes created Thu Nov 07 10:32:03 CST 2024