Closed stefanpenner closed 4 years ago
This appears to be related to https://github.com/ember-cli/ember-cli/issues/9007 I'll hold off on landing this until I fully understand that issue.
confirmed that this does not make ember-cli/ember-cli#9007 worse, rather it is important in landing the relevant fix.
This PR fixes broccoli to no longer unintentionally trigger node's
unhandledRejection
warnings.Specifically these warnings where coming from
watcher.currentBuild
which is a public API, allowing external consumers to consider the latest builds outcome. For example the broccoli express middleware will on each request followwatcher.currentBuild
. On fulfillment it will serve the file in question, or on rejection it will provide a useful error page.watcher.currentBuild
is the downstream promise of several internal watcher promises, each of which already handle rejections correctly appropriately.This commit ensures external consumers of
currentBuild
are correctly notified of the final promise state, but without any external consumers rejections ofcurrentBuild
are considered handled.The test here is the addition of failing the test if there are any unhandled rejection warnings.