play()

mockyeah.play(suiteName)

suiteName (String|String[]; required) Suite name(s) to mount.

Mounts the specified suite in the suites directory (e.g., ./mockyeah/mySuite/index.js). This behavior may be changed by altering the values in the suite files.

You can also pass an array of suite names, or a single string with comma-separated list of suite names, e.g.:

mockyeah.play('some-custom-suite,some-custom-suite-2');

or:

mockyeah.play(['some-custom-suite', 'some-custom-suite-2']);

Or on the CLI, comma-separated:

$ mockyeah play some-custom-suite,some-custom-suite-2

or space-separated:

$ mockyeah play some-custom-suite some-custom-suite-2

Here is an example of a suite file:

module.exports = [
  [
    'http://example.com/some/service',
    {
      headers: {
        'x-powered-by': 'Express',
        'content-type': 'text/plain; charset=utf-8',
        'content-length': '12'
      },
      status: 200,
      raw: 'Hello world!',
      latency: 57
    }
  ]
];

results matching ""

    No results matching ""