• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3const common = require('../common');
4common.skipIfInspectorDisabled();
5
6(async function test() {
7  const assert = require('assert');
8  const { Session } = require('inspector');
9  const { promisify } = require('util');
10
11  const session = new Session();
12  session.connect();
13  session.post = promisify(session.post);
14  await assert.rejects(
15    session.post('Runtime.evaluate', {
16      expression: 'for(;;);',
17      timeout: 0
18    }),
19    {
20      code: 'ERR_INSPECTOR_COMMAND',
21      message: 'Inspector error -32000: Execution was terminated'
22    }
23  );
24  session.disconnect();
25})().then(common.mustCall());
26