From: Ronald Holshausen Date: Tue, 5 Jan 2021 04:45:55 +0000 (+1100) Subject: feat: URLs are now injected by the mock server X-Git-Tag: wip-umbau-array-contains~20 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=c2f3e1689ea59ac1d35f0576ba5af6bac8b0ccbf;p=demos%2Fexample-siren feat: URLs are now injected by the mock server --- diff --git a/consumer/package.json b/consumer/package.json index 03d024a..0741577 100644 --- a/consumer/package.json +++ b/consumer/package.json @@ -9,7 +9,7 @@ "author": "", "license": "MIT", "devDependencies": { - "@pact-foundation/pact": "^10.0.0-beta.19", + "@pact-foundation/pact": "^10.0.0-beta.23", "chai": "^4.2.0", "chai-as-promised": "^7.1.1", "jest": "^26.4.2" diff --git a/consumer/src/__tests__/delete-order.spec.js b/consumer/src/__tests__/delete-order.spec.js index 988f84a..88498b9 100644 --- a/consumer/src/__tests__/delete-order.spec.js +++ b/consumer/src/__tests__/delete-order.spec.js @@ -22,7 +22,6 @@ describe("Siren Pact test", () => { provider = new PactV3({ consumer: "Siren Order Provider", provider: "Siren Order Service", - port: 9000, dir: path.resolve(process.cwd(), "pacts") }) }) @@ -41,8 +40,8 @@ describe("Siren Pact test", () => { 'Content-Type': 'application/vnd.siren+json' }, body: { - class:[ "representation"], - links:[{"rel":["orders"], "href": url("http://localhost:9000", ["orders"]) }] + class: [ "representation"], + links: [{"rel":["orders"], "href": url(["orders"]) }] } }) @@ -67,26 +66,26 @@ describe("Siren Pact test", () => { links: [ { "rel": [ "self" ], - "href": url("http://localhost:9000", ["orders", regex("\\d+", "1234")]) + "href": url(["orders", regex("\\d+", "1234")]) } ], "actions": arrayContaining( { "name": "update", "method": "PUT", - "href": url("http://localhost:9000", ["orders", regex("\\d+", "1234")]) + "href": url(["orders", regex("\\d+", "1234")]) }, { "name": "delete", "method": "DELETE", - "href": url("http://localhost:9000", ["orders", regex("\\d+", "1234")]) + "href": url(["orders", regex("\\d+", "1234")]) } ) }), links: [ { rel: [ "self" ], - href: url("http://localhost:9000", ["orders"]) + href: url(["orders"]) } ] }