diff --git a/test/sequential/test-debugger-exec-scope.js b/test/sequential/test-debugger-exec-scope.js deleted file mode 100644 index 9e5d2ac7ebaeeb..00000000000000 --- a/test/sequential/test-debugger-exec-scope.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; -const common = require('../common'); - -common.skipIfInspectorDisabled(); - -const fixtures = require('../common/fixtures'); -const startCLI = require('../common/debugger'); - -const assert = require('assert'); - -// exec .scope -{ - const cli = startCLI([fixtures.path('debugger/backtrace.js')]); - - function onFatal(error) { - cli.quit(); - throw error; - } - - cli.waitForInitialBreak() - .then(() => cli.waitForPrompt()) - .then(() => cli.stepCommand('c')) - .then(() => cli.command('exec .scope')) - .then(() => { - assert.match( - cli.output, - /'moduleScoped'/, 'displays closure from module body'); - assert.match(cli.output, /'a'/, 'displays local / function arg'); - assert.match(cli.output, /'l1'/, 'displays local scope'); - assert.doesNotMatch( - cli.output, - /'encodeURIComponent'/, - 'omits global scope' - ); - }) - .then(() => cli.quit()) - .then(null, onFatal); -} diff --git a/test/sequential/test-debugger-exec-scope.mjs b/test/sequential/test-debugger-exec-scope.mjs new file mode 100644 index 00000000000000..08b37e279556f2 --- /dev/null +++ b/test/sequential/test-debugger-exec-scope.mjs @@ -0,0 +1,23 @@ +import { skipIfInspectorDisabled } from '../common/index.mjs'; + +skipIfInspectorDisabled(); + +import { path } from '../common/fixtures.mjs'; +import startCLI from '../common/debugger.js'; + +import assert from 'assert'; + +const cli = startCLI([path('debugger/backtrace.js')]); + +try { + await cli.waitForInitialBreak(); + await cli.waitForPrompt(); + await cli.stepCommand('c'); + await cli.command('exec .scope'); + assert.match(cli.output, /'moduleScoped'/, 'displays closure from module body'); + assert.match(cli.output, /'a'/, 'displays local / function arg'); + assert.match(cli.output, /'l1'/, 'displays local scope'); + assert.doesNotMatch(cli.output, /'encodeURIComponent'/, 'omits global scope'); +} finally { + await cli.quit(); +}