Report invalid --require
directly instead of via UnhandledPromiseRejectionWarning
#1688
Labels
--require
directly instead of via UnhandledPromiseRejectionWarning
#1688
We have a test case
displays helpful error when failing to require a file
intest/cli/cli-main.js
which. The assertion currently ensures that the output "includes" the important subset, which isError: Cannot find module 'does-not-exist-at-all'
.However, when running it directly (in prep for #1684) I noticed it gets there in quite an unsual manner:
This happens because
/src/cli/run.js
currently handlesoptions.requires
before setting upoptions.reporter
andprocess.on('unhandledRejection')
. I suggest we swap this around.The text was updated successfully, but these errors were encountered: