summaryrefslogtreecommitdiffstats
path: root/testing/mochitest/tests/browser/browser_fail_uncaught_rejection_expected.js
blob: 6c30d4eb3dc16bd9256ce3ad988345428d0e3515 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
setExpectedFailuresForSelfTest(1);

// The test will fail because there is only one of two expected rejections.
const { PromiseTestUtils } = ChromeUtils.importESModule(
  "resource://testing-common/PromiseTestUtils.sys.mjs"
);
PromiseTestUtils.expectUncaughtRejection(/Promise rejection./);
PromiseTestUtils.expectUncaughtRejection(/Promise rejection./);

function test() {
  Promise.reject(new Error("Promise rejection."));
}