0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/sequential/test-inspector-runtime-evaluate-with-timeout.js
Anna Henningsen f7b5eacaa6 test: remove unnecessary --expose-internals flags
PR-URL: https://github.com/nodejs/node/pull/29886
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-10-10 11:59:31 -07:00

26 lines
598 B
JavaScript

'use strict';
const common = require('../common');
common.skipIfInspectorDisabled();
(async function test() {
const assert = require('assert');
const { Session } = require('inspector');
const { promisify } = require('util');
const session = new Session();
session.connect();
session.post = promisify(session.post);
await assert.rejects(
session.post('Runtime.evaluate', {
expression: 'for(;;);',
timeout: 0
}),
{
code: 'ERR_INSPECTOR_COMMAND',
message: 'Inspector error -32000: Execution was terminated'
}
);
session.disconnect();
})();