Introduced expectFail function to reduce duplication when verifying rejected promises