mockyeah

A powerful service mocking, recording, and playback utility.

Notice: These docs are for mockyeah 1.x & above. For legacy mockyeah 0.x, please see https://mockyeah.github.io/mockyeah/.

Match Values

Match values are used both in mock definitions and in expectations. They are a way to support generic pattern matching on values.

An match value can be a string, regular expression, plain object, or function that will be tested against a given input value.

A string will be compared for equality with the input value.

A regular expression will be tested with the input value.

Functions will receive the input value as an argument, and can either explicitly return true or false to indicate pass or fail, or they can possibly throw an error, or otherwise return undefined, to indicate fail or pass respectively.

Plain objects will do a deep partial match, recursively considering each level in the input value (which is assumed to be an object) as another match value.


© 2020 mockyeah, Built with Gatsby