How to use the @pact-foundation/pact.Matchers.eachLike function in @pact-foundation/pact

To help you get started, we’ve selected a few @pact-foundation/pact examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pact-foundation / pact-js / examples / jest / __tests__ / catAPI.spec.js View on Github external
beforeEach(() => {
      const interaction = {
        state: "i have a list of cats",
        uponReceiving: "a request for cats with given catId",
        withRequest: {
          method: "GET",
          path: "/cats",
          query: {
            "catId[]": Matchers.eachLike("1"),
          },
          headers: {
            Accept: "application/json",
          },
        },
        willRespondWith: {
          status: 200,
          headers: {
            "Content-Type": "application/json",
          },
          body: EXPECTED_BODY,
        },
      }

      return provider.addInteraction(interaction)
    })