logsPropCombinationError function

_PropTypeLogMatcher logsPropCombinationError(
  1. String propName,
  2. String prop2Name, [
  3. String message = ''
])

A matcher to verify that a PropError.combination is thrown with the provided propName, prop2Name, and optional message.

This matcher only works for PropError.combinations that are returned within UiComponent2.propTypes. If you are testing a PropError.combination that is thrown anywhere else within a component, use throwsPropError_Combination.

This matcher is built on top of logsPropTypeWarning and has the same behavior of running the provided callback, swallowing errors that occur, and looking for the expected PropError.combination in the resulting logs.

NOTE: Will only produce failures when tests are run using the dartdevc compiler since the react package "tree shakes" propTypes from dart2js compiled output.

Implementation

_PropTypeLogMatcher logsPropCombinationError(String propName, String prop2Name, [String message = '']) {
  return logsPropTypeWarning('InvalidPropCombinationError: Prop $propName and prop $prop2Name are set to '
      'incompatible values. $message'.trim());
}