free-games-claimer/test/sigint-enquirer-raw.js
nocci 5f919039ab
Some checks failed
build-and-push / lint (push) Failing after 4s
build-and-push / sonar (push) Has been skipped
build-and-push / docker (push) Has been skipped
Clean Sonar issues in store scripts
2025-12-30 16:08:59 +00:00

18 lines
571 B
JavaScript

// https://github.com/enquirer/enquirer/issues/372
import { prompt, handleSIGINT } from '../src/util.js';
handleSIGINT();
console.log('hello');
console.error('hello error');
try {
let i = await prompt(); // SIGINT no longer handled if this is executed
i = await prompt(); // SIGINT no longer handled if this is executed
console.log('value:', i);
setTimeout(() => console.log('timeout 3s'), 3000);
} catch (e) {
process.exitCode ||= 1;
console.log('catch. exitCode:', process.exitCode);
console.error(e);
}
console.log('end. exitCode:', process.exitCode);