From ab6b35ea3125463dc16eed4fc28c172c28a9c1e6 Mon Sep 17 00:00:00 2001 From: Meek Denzo Date: Thu, 9 Jun 2022 20:17:57 -0500 Subject: [PATCH 1/2] test: refactor to top-level await --- .../test-debugger-extract-function-name.mjs | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 test/parallel/test-debugger-extract-function-name.mjs diff --git a/test/parallel/test-debugger-extract-function-name.mjs b/test/parallel/test-debugger-extract-function-name.mjs new file mode 100644 index 00000000000000..e457fc7f521521 --- /dev/null +++ b/test/parallel/test-debugger-extract-function-name.mjs @@ -0,0 +1,33 @@ +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', 'three-lines.js')]); + +try { + await cli.waitForInitialBreak(); + await cli.waitForPrompt(); + await cli.command('exec a = function func() {}; a;'); + assert.match(cli.output, /\[Function: func\]/); + await cli.command('exec a = function func () {}; a;'); + assert.match(cli.output, /\[Function\]/); + await cli.command('exec a = function() {}; a;'); + assert.match(cli.output, /\[Function: function\]/); + await cli.command('exec a = () => {}; a;'); + assert.match(cli.output, /\[Function\]/); + await cli.command('exec a = function* func() {}; a;'); + assert.match(cli.output, /\[GeneratorFunction: func\]/); + await cli.command('exec a = function *func() {}; a;'); + assert.match(cli.output, /\[GeneratorFunction: \*func\]/); + await cli.command('exec a = function*func() {}; a;'); + assert.match(cli.output, /\[GeneratorFunction: function\*func\]/); + await cli.command('exec a = function * func() {}; a;'); + assert.match(cli.output, /\[GeneratorFunction\]/); +} finally { + cli.quit(); +} From fcb6136925f98128c52951a2e8051b6f9a18d864 Mon Sep 17 00:00:00 2001 From: Meek Denzo Date: Thu, 16 Jun 2022 10:09:23 -0500 Subject: [PATCH 2/2] test: remove test-name-dubugger-extract-function-name.js --- .../test-debugger-extract-function-name.js | 34 ------------------- 1 file changed, 34 deletions(-) delete mode 100644 test/parallel/test-debugger-extract-function-name.js diff --git a/test/parallel/test-debugger-extract-function-name.js b/test/parallel/test-debugger-extract-function-name.js deleted file mode 100644 index 0f43ae65837831..00000000000000 --- a/test/parallel/test-debugger-extract-function-name.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; -const common = require('../common'); - -common.skipIfInspectorDisabled(); - -const fixtures = require('../common/fixtures'); -const startCLI = require('../common/debugger'); - -const assert = require('assert'); - -const cli = startCLI([fixtures.path('debugger', 'three-lines.js')]); - -(async () => { - await cli.waitForInitialBreak(); - await cli.waitForPrompt(); - await cli.command('exec a = function func() {}; a;'); - assert.match(cli.output, /\[Function: func\]/); - await cli.command('exec a = function func () {}; a;'); - assert.match(cli.output, /\[Function\]/); - await cli.command('exec a = function() {}; a;'); - assert.match(cli.output, /\[Function: function\]/); - await cli.command('exec a = () => {}; a;'); - assert.match(cli.output, /\[Function\]/); - await cli.command('exec a = function* func() {}; a;'); - assert.match(cli.output, /\[GeneratorFunction: func\]/); - await cli.command('exec a = function *func() {}; a;'); - assert.match(cli.output, /\[GeneratorFunction: \*func\]/); - await cli.command('exec a = function*func() {}; a;'); - assert.match(cli.output, /\[GeneratorFunction: function\*func\]/); - await cli.command('exec a = function * func() {}; a;'); - assert.match(cli.output, /\[GeneratorFunction\]/); -})() -.finally(() => cli.quit()) -.then(common.mustCall());