beforeAll(async function(state) { const DEVTOOLS_DIR = path.dirname( require.resolve('chrome-devtools-frontend/front_end/shell.json')); const frontendFolder = await fsMkdtemp(path.join(os.tmpdir(), 'ndb-test-frontend-')); await new ReleaseBuilder([ path.join(__dirname, '..', 'front_end'), DEVTOOLS_DIR, path.join(__dirname, '..'), path.join(__dirname, '..', '..', '..') ], frontendFolder).buildApp('integration_test_runner'); state.frontendFolder = frontendFolder; });
xit('repl and uncaught error', async function() { const configDir = await fsMkdtemp(path.join(os.tmpdir(), 'ndb-test-')); const frontend = await launch({ configDir: configDir, argv: ['.'], cwd: path.join(__dirname, 'assets', 'test-project'), debugFrontend: false, doNotCopyPreferences: true }); const consolePrompt = await frontend.waitForSelector('body /deep/ #console-prompt'); await frontend.type('body /deep/ #console-prompt', 'require("child_process").spawn("!@#$%")'); await consolePrompt.press('Enter'); await frontend.type('body /deep/ #console-prompt', 'console.log(42)'); consolePrompt.press('Enter'); const consoleMessage = await frontend.waitForSelector('body /deep/ .console-message-wrapper:nth-child(6) .console-message-text'); assert.equal('42', await frontend.evaluate(x => x.innerText, consoleMessage)); await frontend.close(); await util.promisify(removeFolder)(configDir); });
xit('run configuration', async function() { const configDir = await fsMkdtemp(path.join(os.tmpdir(), 'ndb-test-')); const frontend = await launch({ configDir: configDir, argv: ['.'], cwd: path.join(__dirname, 'assets', 'test-project'), debugFrontend: false, doNotCopyPreferences: true }); const configItem = await frontend.waitForSelector('body /deep/ .list-item'); configItem.hover(); const runButton = await frontend.waitForSelector('body /deep/ .list-item /deep/ [aria-label=Run]', { visible: true }); runButton.click(); const consoleMessage = await frontend.waitForSelector('body /deep/ .console-message-wrapper:nth-child(3) .console-message-text'); assert.equal('42', await frontend.evaluate(x => x.innerText, consoleMessage)); await frontend.close(); await util.promisify(removeFolder)(configDir); });
it('Stay attached', async function(state) { const configDir = await fsMkdtemp(path.join(os.tmpdir(), 'ndb-test-')); const frontend = await launch({ configDir: configDir, argv: ['.'], cwd: path.join(__dirname, 'assets', 'test-project'), debugFrontend: false, doNotCopyPreferences: true, appName: 'integration_test_runner', releaseFrontendFolder: state.frontendFolder, doNotProcessExit: true }); await setupHelpers(frontend); await frontend.setSetting('waitAtEnd', true); frontend.runConfiguration('atexit'); await frontend.waitForConsoleMessage('42'); const processes = await frontend.nodeProcess(); processes.sort(); assert.equal(`node -e process.once('exit', _ => console.log(42))`, processes[0]); assert.equal(`node npm run atexit`, processes[1]); const targetDestroyed = frontend.waitTargetDestroyed(2); await frontend.killProcess(`node -e process.once('exit', _ => console.log(42))`); await targetDestroyed; assert.deepStrictEqual([], await frontend.nodeProcess()); await frontend.close(); await util.promisify(removeFolder)(configDir); });
xit('terminal exit', async function() { const configDir = await fsMkdtemp(path.join(os.tmpdir(), 'ndb-test-')); const frontend = await launch({ configDir: configDir,
it('breakpoint inside .mjs file', async function(state) { const configDir = await fsMkdtemp(path.join(os.tmpdir(), 'ndb-test-')); const frontend = await launch({ configDir: configDir,
xit('terminal', async function() { const configDir = await fsMkdtemp(path.join(os.tmpdir(), 'ndb-test-')); const frontend = await launch({ configDir: configDir,
xit('run, pause at start, kill', async function() { const configDir = await fsMkdtemp(path.join(os.tmpdir(), 'ndb-test-')); const frontend = await launch({ configDir: configDir,