Add assertInvalid function as syntax sugar