How to use the @pact-foundation/pact.Matchers.like 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 replicatedhq / kots / web / src / contracts / ship-cloud-api / contracts / kots-downstream-history-no-notes.js View on Github external
.withOperation("getKotsDownstreamHistory")
    .withQuery(getKotsDownstreamHistoryRaw)
    .withVariables({
      clusterSlug: "kots-no-release-notes-cluster-slug",
      upstreamSlug: "kots-no-release-notes-app-slug"
    })
    .willRespondWith({
      status: 200,
      headers: { "Content-Type": "application/json" },
      body: {
        data: {
          getKotsDownstreamHistory: [
            {
              "title": "kots-no-release-notes-version-label",
              "status": "pending",
              "createdOn": Matchers.like("Fri Apr 19 2019 01:23:45 GMT+0000 (Coordinated Universal Time)"),
              "sequence": 0,
              "releaseNotes": "",
              "deployedAt": Matchers.like("Fri Apr 19 2019 01:23:45 GMT+0000 (Coordinated Universal Time)"),
              "preflightResult": null,
              "preflightResultCreatedAt": null
            }

          ],
        },
      },
    });
};
github replicatedhq / kots / web / src / contracts / ship-cloud-api / contracts / kots-downstream-history-with-notes.js View on Github external
.withOperation("getKotsDownstreamHistory")
    .withQuery(getKotsDownstreamHistoryRaw)
    .withVariables({
      clusterSlug: "kots-release-notes-cluster-slug",
      upstreamSlug: "kots-release-notes-app-slug"
    })
    .willRespondWith({
      status: 200,
      headers: { "Content-Type": "application/json" },
      body: {
        data: {
          getKotsDownstreamHistory: [
            {
              "title": "my-other-awesome-version",
              "status": "pending",
              "createdOn": Matchers.like("Fri Apr 19 2019 01:23:45 GMT+0000 (Coordinated Universal Time)"),
              "sequence": 0,
              "releaseNotes": "# Release Notes Markdown Text",
              "deployedAt": Matchers.like("Fri Apr 19 2019 01:23:45 GMT+0000 (Coordinated Universal Time)"),
              "preflightResult": Matchers.like("string"),
              "preflightResultCreatedAt": Matchers.like("Fri Apr 19 2019 01:23:45 GMT+0000 (Coordinated Universal Time)")
            }
          ],
        },
      },
    });
};
github replicatedhq / kots / web / src / contracts / ship-cloud-api / contracts / update-watch.js View on Github external
.withVariables({
    watchId: "single-user-watch-update-1",
    watchName: "Updated Single User Watch Update",
    iconUri: "http://ccsuppliersource.com/wp-content/uploads/2018/12/bigstock_online_update_11303201.jpg"
  })
  .willRespondWith({
    status: 200,
    headers: { "Content-Type": "application/json" },
    body: {
      data: {
        updateWatch: {
          id: "single-user-watch-update-1",
          slug: "single-user/single-user-watch-update-1",
          watchName: "Updated Single User Watch Update",
          watchIcon: "http://ccsuppliersource.com/wp-content/uploads/2018/12/bigstock_online_update_11303201.jpg",
          createdOn: Matchers.like("2019-04-10 12:34:56.789"),
          lastUpdated: Matchers.like("generated"),
          stateJSON: Matchers.like("string"),
          contributors: Matchers.like([{
            avatar_url: "string",
            createdAt: "0001-01-01T00:00:00Z",
            githubId: 1234,
            id: "string",
            login: "string",
          }])
        },
      },
    },
  });
github replicatedhq / kots / web / src / contracts / ship-cloud-api / contracts / get-kots-downstream-history.js View on Github external
upstreamSlug: "get-kots-downstream-history-app-slug"
    })
    .willRespondWith({
      status: 200,
      headers: { "Content-Type": "application/json" },
      body: {
        data: {
          getKotsDownstreamHistory: [
            {
              title: "my-awesome-version",
              status: "pending",
              createdOn: Matchers.like("date"),
              sequence: 0,
              deployedAt: Matchers.like("date"),
              preflightResult: Matchers.like("JSONPreflightResult"),
              preflightResultCreatedAt: Matchers.like("date")
            }
          ],
        },
      },
    });
};
github replicatedhq / kots / web / src / contracts / ship-cloud-api / contracts / update-watch.js View on Github external
watchId: "single-user-watch-update-1",
    watchName: "Updated Single User Watch Update",
    iconUri: "http://ccsuppliersource.com/wp-content/uploads/2018/12/bigstock_online_update_11303201.jpg"
  })
  .willRespondWith({
    status: 200,
    headers: { "Content-Type": "application/json" },
    body: {
      data: {
        updateWatch: {
          id: "single-user-watch-update-1",
          slug: "single-user/single-user-watch-update-1",
          watchName: "Updated Single User Watch Update",
          watchIcon: "http://ccsuppliersource.com/wp-content/uploads/2018/12/bigstock_online_update_11303201.jpg",
          createdOn: Matchers.like("2019-04-10 12:34:56.789"),
          lastUpdated: Matchers.like("generated"),
          stateJSON: Matchers.like("string"),
          contributors: Matchers.like([{
            avatar_url: "string",
            createdAt: "0001-01-01T00:00:00Z",
            githubId: 1234,
            id: "string",
            login: "string",
          }])
        },
      },
    },
  });
github replicatedhq / kots / web / src / contracts / ship-cloud-api / contracts / list-clusters.js View on Github external
"id": "solo-account-cluster-1",
            "title": "Solo Cluster",
            "slug": "solo-cluster",
            "totalApplicationCount": 1,
            "createdOn": Matchers.like("2019-04-10 12:34:56.789"),
            "lastUpdated": Matchers.like("2019-04-11 01:23:45.567"),
            "shipOpsRef": {
              "token": "solo-account-cluster-token",
            },
          },
          {
            "id": "solo-account-cluster-2",
            "title": "Solo GitHub Cluster",
            "slug": "solo-cluster-2",
            "totalApplicationCount": 0,
            "createdOn": Matchers.like("2019-04-10 12:34:56.789"),
            "lastUpdated": Matchers.like("2019-04-11 01:23:45.567"),
            "shipOpsRef": null,
          },
          {
            "id": Matchers.like("l9cpydvcf30ekf25pmokwn6qlnxscrci"),
            "title": "this-cluster",
            "slug": "this-cluster",
            "createdOn": Matchers.like("Wed Jan 22 2020 00:34:12 GMT+0000 (Coordinated Universal Time)"),
            "lastUpdated": null,
            "shipOpsRef": {
              "token": Matchers.like("g7yoarinjpaft3si5z1h5de1uam443bb")
            },
            "totalApplicationCount": 0
          }
        ]
      }
github replicatedhq / kots / web / src / contracts / ship-cloud-api / contracts / update-watch.js View on Github external
iconUri: "http://ccsuppliersource.com/wp-content/uploads/2018/12/bigstock_online_update_11303201.jpg"
  })
  .willRespondWith({
    status: 200,
    headers: { "Content-Type": "application/json" },
    body: {
      data: {
        updateWatch: {
          id: "single-user-watch-update-1",
          slug: "single-user/single-user-watch-update-1",
          watchName: "Updated Single User Watch Update",
          watchIcon: "http://ccsuppliersource.com/wp-content/uploads/2018/12/bigstock_online_update_11303201.jpg",
          createdOn: Matchers.like("2019-04-10 12:34:56.789"),
          lastUpdated: Matchers.like("generated"),
          stateJSON: Matchers.like("string"),
          contributors: Matchers.like([{
            avatar_url: "string",
            createdAt: "0001-01-01T00:00:00Z",
            githubId: 1234,
            id: "string",
            login: "string",
          }])
        },
      },
    },
  });
github replicatedhq / kots / web / src / contracts / ship-cloud-api / contracts / auth / interactions.js View on Github external
method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: {
        email: "test-ship-auth-signup@gmail.com",
        firstName: "First",
        lastName: "Last",
        password: "password",
    },
  })
  .willRespondWith({
    status: 200,
    headers: { "Content-Type": "application/json" },
    body: {
      token: Matchers.like("generated"),
      signup: {
        email: "test-ship-auth-signup@gmail.com",
        id: Matchers.like("generated"),
      },
    }
  });
github replicatedhq / kots / web / src / contracts / ship-cloud-api / contracts / create-init-session.js View on Github external
})
  .withOperation("createInitSession")
  .withQuery(createInitSessionRaw)
  .withVariables({
    pendingInitId: "",
    upstreamUri: "https://github.com/helm/charts/stable/grafana",
    clusterID: null,
    githubPath: null,
  })
  .willRespondWith({
    status: 200,
    headers: { "Content-Type": "application/json" },
    body: {
      data: {
        createInitSession: {
          id: Matchers.like("generated"),
          upstreamUri: "https://github.com/helm/charts/stable/grafana",
          createdOn: Matchers.like("generated"),
        },
      },
    },
  });
github replicatedhq / kots / web / src / contracts / ship-cloud-api / contracts / list-clusters.js View on Github external
"id": "solo-account-cluster-2",
            "title": "Solo GitHub Cluster",
            "slug": "solo-cluster-2",
            "totalApplicationCount": 0,
            "createdOn": Matchers.like("2019-04-10 12:34:56.789"),
            "lastUpdated": Matchers.like("2019-04-11 01:23:45.567"),
            "shipOpsRef": null,
          },
          {
            "id": Matchers.like("l9cpydvcf30ekf25pmokwn6qlnxscrci"),
            "title": "this-cluster",
            "slug": "this-cluster",
            "createdOn": Matchers.like("Wed Jan 22 2020 00:34:12 GMT+0000 (Coordinated Universal Time)"),
            "lastUpdated": null,
            "shipOpsRef": {
              "token": Matchers.like("g7yoarinjpaft3si5z1h5de1uam443bb")
            },
            "totalApplicationCount": 0
          }
        ]
      }
    }
  });