MCPcopy Create free account
hub / github.com/nodejs/node / ctrlCTest

Function ctrlCTest

test/parallel/test-repl-top-level-await.js:207–223  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

205}
206
207async function ctrlCTest() {
208 console.log('Testing Ctrl+C');
209 const output = await runAndWait([
210 'await new Promise(() => {})',
211 { ctrl: true, name: 'c' },
212 ]);
213 assert.deepStrictEqual(output.slice(0, 3), [
214 'await new Promise(() => {})\r',
215 'Uncaught:',
216 '[Error [ERR_SCRIPT_EXECUTION_INTERRUPTED]: ' +
217 'Script execution was interrupted by `SIGINT`] {',
218 ]);
219 assert.deepStrictEqual(output.slice(-2), [
220 '}',
221 PROMPT,
222 ]);
223}
224
225async function main() {
226 await ordinaryTests();

Callers 1

mainFunction · 0.85

Calls 3

runAndWaitFunction · 0.70
sliceMethod · 0.65
logMethod · 0.45

Tested by

no test coverage detected