@pact-foundation/pact 9.17.2 → 9.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,38 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [9.18.1](https://github.com/pact-foundation/pact-js/compare/v9.18.0...v9.18.1) (2022-06-28)
6
+
7
+
8
+ ### Fixes and Improvements
9
+
10
+ * package.json & package-lock.json to reduce vulnerabilities ([#879](https://github.com/pact-foundation/pact-js/issues/879)) ([5005463](https://github.com/pact-foundation/pact-js/commit/50054638342171d8f9972350b2bf601e99b404b3))
11
+
12
+ ## [9.18.0](https://github.com/pact-foundation/pact-js/compare/v9.17.3...v9.18.0) (2022-06-26)
13
+
14
+
15
+ ### Features
16
+
17
+ * drop support for pact web incl. karma examples ([d45f898](https://github.com/pact-foundation/pact-js/commit/d45f898b29a62aa77cecff499a46ce365fd2c79a))
18
+ * modify request body inside of verifer ([#873](https://github.com/pact-foundation/pact-js/issues/873)) ([be8ed15](https://github.com/pact-foundation/pact-js/commit/be8ed151c607b69bcf07670df211156887adb29e))
19
+
20
+
21
+ ### Fixes and Improvements
22
+
23
+ * nestjs example should use branches in workflow ([a7adf07](https://github.com/pact-foundation/pact-js/commit/a7adf07d5563cf7ad92d2054b6913c890ef21220))
24
+ * webpack on node 16 ([903cf44](https://github.com/pact-foundation/pact-js/commit/903cf44dd15f19f6132b6d7bf5f89f0cccc70d41))
25
+
26
+ ### [9.17.3](https://github.com/pact-foundation/pact-js/compare/v9.17.2...v9.17.3) (2022-03-16)
27
+
28
+
29
+ ### Fixes and Improvements
30
+
31
+ * remove rust from v3 release build ([2a5f65b](https://github.com/pact-foundation/pact-js/commit/2a5f65bc7e8a48c7ee786905f78207cba7837110))
32
+ * The table on README.md is corrupted and unreadable ([#832](https://github.com/pact-foundation/pact-js/issues/832)) ([b73fa05](https://github.com/pact-foundation/pact-js/commit/b73fa05a7f92ed81d225f6c68349d322d388656d))
33
+ * throw an error when pact spec version is not set to 2 ([4186c22](https://github.com/pact-foundation/pact-js/commit/4186c22030cc3a7f2abb99c096d480c66f17f2a4))
34
+ * upgrade to latest pact-node ([0d9b127](https://github.com/pact-foundation/pact-js/commit/0d9b1270d4dc03e761941ae060b2a75db0bab24d))
35
+ * verifier req/res logging on debug ([#835](https://github.com/pact-foundation/pact-js/issues/835)) ([3edc5a0](https://github.com/pact-foundation/pact-js/commit/3edc5a035170fb28f74be6b908091e37093cad98))
36
+
5
37
  ### [9.17.2](https://github.com/pact-foundation/pact-js/compare/v9.17.1...v9.17.2) (2022-01-12)
6
38
 
7
39
 
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
55
55
  ## Enforcement
56
56
 
57
57
  Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at pact-support@googlegroups.com. All
58
+ reported by contacting the project team at pact-foundation@googlegroups.com. All
59
59
  complaints will be reviewed and investigated and will result in a response that
60
60
  is deemed necessary and appropriate to the circumstances. The project team is
61
61
  obligated to maintain confidentiality with regard to the reporter of an incident.
package/README.md CHANGED
@@ -42,6 +42,7 @@ Read [Getting started with Pact] for more information for beginners.
42
42
  - [HTTP API Testing](#http-api-testing)
43
43
  - [Consumer Side Testing](#consumer-side-testing)
44
44
  - [API](#api)
45
+ - [Constructor](#constructor)
45
46
  - [Example](#example)
46
47
  - [Provider API Testing](#provider-api-testing)
47
48
  - [Verification Options](#verification-options)
@@ -55,7 +56,7 @@ Read [Getting started with Pact] for more information for beginners.
55
56
  - [Publishing Pacts to a Broker](#publishing-pacts-to-a-broker)
56
57
  - [Publish in npm scripts](#publish-in-npm-scripts)
57
58
  - [Publish in a custom script](#publish-in-a-custom-script)
58
- - [Pact publishing options](#pact-publishing-options)
59
+ - [Pact publishing options](#pact-publishing-options)
59
60
  - [Publishing Verification Results to a Pact Broker](#publishing-verification-results-to-a-pact-broker)
60
61
  - [Asynchronous API Testing](#asynchronous-api-testing)
61
62
  - [Consumer](#consumer)
@@ -71,9 +72,7 @@ Read [Getting started with Pact] for more information for beginners.
71
72
  - [Examples](#examples)
72
73
  - [HTTP APIs](#http-apis)
73
74
  - [Asynchronous APIs](#asynchronous-apis)
74
- - [Using Pact in non-Node environments](#using-pact-in-non-node-environments)
75
- - [Using Pact with Karma](#using-pact-with-karma)
76
- - [Using Pact with RequireJS](#using-pact-with-requirejs)
75
+ - [Using Pact in non-Node environments such as Karma](#using-pact-in-non-node-environments-such-as-karma)
77
76
  - [Pact JS V3](#pact-js-v3)
78
77
  - [Using the V3 matching rules](#using-the-v3-matching-rules)
79
78
  - [Using Pact with XML](#using-pact-with-xml)
@@ -83,6 +82,7 @@ Read [Getting started with Pact] for more information for beginners.
83
82
  - [Debugging issues with Pact-JS V3](#debugging-issues-with-pact-js-v3)
84
83
  - [Debugging](#debugging)
85
84
  - [Troubleshooting / FAQs](#troubleshooting--faqs)
85
+ - [Actual interactions do not match expected interactions for mock MockService.](#actual-interactions-do-not-match-expected-interactions-for-mock-mockservice)
86
86
  - [Corporate Proxies / Firewalls](#corporate-proxies--firewalls)
87
87
  - [Alpine + Docker](#alpine--docker)
88
88
  - [Parallel tests](#parallel-tests)
@@ -100,11 +100,19 @@ Read [Getting started with Pact] for more information for beginners.
100
100
 
101
101
  ## Installation
102
102
 
103
+ NPM
104
+ ```sh
105
+ npm install --save-dev @pact-foundation/pact@latest
103
106
  ```
104
- npm i -S @pact-foundation/pact@latest
107
+
108
+ Yarn
109
+
110
+ ```sh
111
+ yarn add --dev @pact-foundation/pact@latest
105
112
  ```
106
113
 
107
- Make sure the `ignore-scripts` option is disabled, pact uses npm scripts to download further dependencies.
114
+ - Ensure you install the package as `devDependencies` by using [`--save-dev`][npm-devdep]/[`--dev`][yarn-devdep] ;
115
+ - Make sure the `ignore-scripts` option is disabled, pact uses npm scripts to download further dependencies.
108
116
 
109
117
  ### Do Not Track
110
118
 
@@ -156,8 +164,6 @@ The `Pact` class provides the following high-level APIs, they are listed in the
156
164
 
157
165
  #### API
158
166
 
159
- <details><summary>Consumer API</summary>
160
-
161
167
  | API | Options | Returns | Description |
162
168
  | ------------------- | ----------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
163
169
  | `new Pact(options)` | See constructor options below | `Object` | Creates a Mock Server test double of your Provider API. If you need multiple Providers for a scenario, you can create as many as these as you need. |
@@ -166,9 +172,7 @@ The `Pact` class provides the following high-level APIs, they are listed in the
166
172
  | `verify()` | n/a | `Promise` | Verifies that all interactions specified. This should be called once per test, to ensure your expectations were correct |
167
173
  | `finalize()` | n/a | `Promise` | Records the interactions registered to the Mock Server into the pact file and shuts it down. You would normally call this only once in an `afterAll(...)` type clause. |
168
174
 
169
- </details>
170
-
171
- <details><summary>Constructor</summary>
175
+ #### Constructor
172
176
 
173
177
  | Parameter | Required? | Type | Description |
174
178
  | ------------------- | --------- | ------- | -------------------------------------------------------------------------------------------------------- |
@@ -185,9 +189,7 @@ The `Pact` class provides the following high-level APIs, they are listed in the
185
189
  | `spec` | no | number | Pact specification version (defaults to 2) |
186
190
  | `cors` | no | boolean | Allow CORS OPTION requests to be accepted, defaults to false |
187
191
  | `pactfileWriteMode` | no | string | Control how the Pact files are written. Choices: 'overwrite' 'update' or 'none'. Defaults to 'overwrite' |
188
- | `timeout` | no | number | The time to wait for the mock server to start up in milliseconds. Defaults to 30 seconds (30000) |
189
-
190
- </details>
192
+ | `timeout` | no | number | The time to wait for the mock server to start up in milliseconds. Defaults to 30 seconds (30000) |
191
193
 
192
194
  #### Example
193
195
 
@@ -200,7 +202,7 @@ The first step is to create a test for your API Consumer. The example below uses
200
202
  1. Validate the expected interactions were made between your consumer and the Mock Service
201
203
  1. Generate the pact(s)
202
204
 
203
- Check out the `examples` folder for examples with Karma Jasmine, Mocha and Jest. The example below is taken from the [integration spec](https://github.com/pact-foundation/pact-js/blob/master/src/pact.integration.spec.ts).
205
+ Check out the `examples` folder for examples with Mocha and Jest. The example below is taken from the [integration spec](https://github.com/pact-foundation/pact-js/blob/master/src/pact.integration.spec.ts).
204
206
 
205
207
  ```javascript
206
208
  const path = require("path")
@@ -289,16 +291,12 @@ describe("Pact", () => {
289
291
 
290
292
  ### Provider API Testing
291
293
 
292
- <details><summary>Provider API</summary>
293
-
294
294
  Once you have created Pacts for your Consumer, you need to validate those Pacts against your Provider. The Verifier object provides the following API for you to do so:
295
295
 
296
296
  | API | Options | Returns | Description |
297
297
  | ------------------ | :-------: | --------- | --------------------- |
298
298
  | `verifyProvider()` | See below | `Promise` | Start the Mock Server |
299
299
 
300
- </details>
301
-
302
300
  1. Start your local Provider service.
303
301
  1. Optionally, instrument your API with ability to configure [provider states](https://github.com/pact-foundation/pact-provider-verifier/)
304
302
  1. Then run the Provider side verification step
@@ -316,10 +314,8 @@ new Verifier(opts).verifyProvider().then(function () {
316
314
 
317
315
  #### Verification Options
318
316
 
319
- <details><summary>Verification Options</summary>
320
-
321
317
  | Parameter | Required? | Type | Description |
322
- | --------------------------- | --------- | ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
318
+ | --------------------------- | --------- | ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
323
319
  | `providerBaseUrl` | true | string | Running API provider host endpoint. |
324
320
  | `pactBrokerUrl` | false | string | Base URL of the Pact Broker from which to retrieve the pacts. Required if `pactUrls` not given. |
325
321
  | `provider` | false | string | Name of the provider if fetching from a Broker |
@@ -337,15 +333,13 @@ new Verifier(opts).verifyProvider().then(function () {
337
333
  | `pactBrokerPassword` | false | string | Password for Pact Broker basic authentication |
338
334
  | `pactBrokerToken` | false | string | Bearer token for Pact Broker authentication |
339
335
  | `publishVerificationResult` | false | boolean | Publish verification result to Broker (_NOTE_: you should only enable this during CI builds) |
340
- | `customProviderHeaders` | false | array | Header(s) to add to provider state set up and pact verification | | `requests`. eg 'Authorization: Basic cGFjdDpwYWN0'. |
336
+ | `customProviderHeaders` | false | array | Header(s) to add to provider state set up and pact verification | | `requests`. eg 'Authorization: Basic cGFjdDpwYWN0'. |
341
337
  | `providerVersion` | false | string | Provider version, required to publish verification result to Broker. Optional otherwise. |
342
338
  | `enablePending` | false | boolean | Enable the [pending pacts](https://docs.pact.io/pending) feature. |
343
339
  | `timeout` | false | number | The duration in ms we should wait to confirm verification process was successful. Defaults to 30000. |
344
340
  | `format` | false | string | What format the verification results are printed in. Options are `json`, `xml`, `progress` and `RspecJunitFormatter` (which is a synonym for `xml`) |
345
341
  | `verbose` | false | boolean | Enables verbose output for underlying pact binary. |
346
342
 
347
- </details>
348
-
349
343
  To dynamically retrieve pacts from a Pact Broker for a provider, provide the broker URL, the name of the provider, and the consumer version tags that you want to verify:
350
344
 
351
345
  ```js
@@ -440,7 +434,7 @@ Pending pacts is a feature that allows consumers to publish new contracts or cha
440
434
 
441
435
  This enables safe introduction of new contracts into the system, without breaking Provider builds, whilst still providing feedback to Consumers as per before.
442
436
 
443
- See the [docs](https://docs.pact.io/pending) and this [article](http://blog.pact.io/2020/02/24/how-we-have-fixed-the-biggest-problem-with-the-pact-workflow/) for more background.
437
+ See the [docs](https://docs.pact.io/pending) and this [article](https://docs.pact.io/blog/2020/02/24/how-weve-fixed-the-biggest-problem-with-the-pact-workflow) for more background.
444
438
 
445
439
  #### WIP Pacts
446
440
 
@@ -448,7 +442,7 @@ _NOTE_: This feature is available on [Pactflow] by default, and requires [config
448
442
 
449
443
  WIP Pacts builds upon pending pacts, enabling provider tests to pull in _any_ contracts applicable to the provider regardless of the `tag` it was given. This is useful, because often times consumers won't follow the exact same tagging convention and so their workflow would be interrupted. This feature enables any pacts determined to be "work in progress" to be verified by the Provider, without causing a build failure. You can enable this behaviour by specifying a valid timestamp for `includeWipPactsSince`. This sets the start window for which new WIP pacts will be pulled down for verification, regardless of the tag.
450
444
 
451
- See the [docs](https://docs.pact.io/wip) and this [article](http://blog.pact.io/2020/02/24/introducing-wip-pacts/) for more background.
445
+ See the [docs](https://docs.pact.io/wip) and this [article](https://docs.pact.io/blog/2020/02/24/introducing-wip-pacts) for more background.
452
446
 
453
447
  #### Verifying multiple contracts with the same tag (e.g. for Mobile use cases)
454
448
 
@@ -550,7 +544,7 @@ The easiest way to publish pacts to the broker is via an npm script in your pack
550
544
 
551
545
  ```
552
546
 
553
- "pact:publish": "pact-broker publish <YOUR_PACT_FILES_OR_DIR> --consumer-app-version=\"$(npx @pact-foundation/absolute-version)\" --tag-with-git-branch --broker-base-url=https://your-broker-url.example.com"
547
+ "pact:publish": "pact-broker publish <YOUR_PACT_FILES_OR_DIR> --consumer-app-version=\"$(npx absolute-version)\" --auto-detect-version-properties --broker-base-url=https://your-broker-url.example.com"
554
548
  ```
555
549
 
556
550
  For a full list of the options, see the [CLI usage instructions](https://github.com/pact-foundation/pact-ruby-standalone/releases).
@@ -581,21 +575,17 @@ new Publisher(opts)
581
575
 
582
576
  #### Pact publishing options
583
577
 
584
- <details><summary>Publishing Options</summary>
585
-
586
578
  | Parameter | Required | Type | Description |
587
579
  | -------------------- | :------: | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
588
580
  | `providerBaseUrl` | `false` | string | Running API provider host endpoint. |
589
581
  | `pactFilesOrDirs` | `true` | array of strings | Array of local Pact files or directories containing pact files. Path must be absolute. Required. |
590
- | `pactBroker` | `true` | string | The base URL of the Pact Broker. eg. https://test.pact.dius.com.au. Required. |
582
+ | `pactBroker` | `true` | string | The base URL of the Pact Broker. eg. https://test.pactflow.io. Required. |
591
583
  | `pactBrokerToken` | `false` | string | Bearer token for Pact Broker authentication. Optional. If using Pactflow, you likely need this option |
592
584
  | `pactBrokerUsername` | `false` | string | Username for Pact Broker basic authentication. Optional. If using Pactflow, you most likely need to use `pactBrokerToken` |
593
585
  | `pactBrokerPassword` | `false` | string | Password for Pact Broker basic authentication. Optional. If using Pactflow, you most likely need to use `pactBrokerToken` |
594
586
  | `consumerVersion` | `true` | string | The consumer application version; e.g. '1.0.0-cac389f'. ([See more info on versioning](https://docs.pact.io/getting_started/versioning_in_the_pact_broker)) |
595
587
  | `tags` | `false` | array of strings | Tag your pacts, often used with your branching, release or environment strategy e.g. ['prod', 'test'] |
596
588
 
597
- </details>
598
-
599
589
  If your broker has a self signed certificate, set the environment variable `SSL_CERT_FILE` (or `SSL_CERT_DIR`) pointing to a copy of your certificate.
600
590
 
601
591
  #### Publishing Verification Results to a Pact Broker
@@ -648,7 +638,7 @@ const {
648
638
  } = require("@pact-foundation/pact")
649
639
 
650
640
  // 1 Dog API Handler
651
- const dogApiHandler = function(dog) {
641
+ const dogApiHandler = function (dog) {
652
642
  if (!dog.id && !dog.name && !dog.type) {
653
643
  throw new Error("missing fields")
654
644
  }
@@ -775,8 +765,6 @@ _NOTE: Make sure to start the mock service via the `Pact` declaration with the o
775
765
 
776
766
  Often times, you find yourself having to re-write regular expressions for common formats. We've created a number of them for you to save you the time:
777
767
 
778
- <details><summary>Matchers API</summary>
779
-
780
768
  | method | description |
781
769
  | --------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
782
770
  | `boolean` | Match a boolean value (using equality) |
@@ -794,8 +782,6 @@ Often times, you find yourself having to re-write regular expressions for common
794
782
  | `uuid` | Will match strings containing UUIDs |
795
783
  | `email` | Will match strings containing Email address |
796
784
 
797
- </details>
798
-
799
785
  ### Match based on type
800
786
 
801
787
  ```javascript
@@ -947,8 +933,6 @@ The workshop takes you through all of the key concepts using a React consumer an
947
933
  - [Pact with TypeScript + Mocha](https://github.com/pact-foundation/pact-js/tree/master/examples/typescript)
948
934
  - [Pact with Mocha](https://github.com/pact-foundation/pact-js/tree/master/examples/mocha)
949
935
  - [Pact with GraphQL](https://github.com/pact-foundation/pact-js/tree/master/examples/graphql)
950
- - [Pact with Karma + Jasmine](https://github.com/pact-foundation/pact-js/tree/master/examples/karma/jasmine)
951
- - [Pact with Karma + Mocha](https://github.com/pact-foundation/pact-js/tree/master/examples/karma/mocha)
952
936
  - [Pact with React + Jest](https://github.com/pact-foundation/pact-workshop-js)
953
937
 
954
938
  ### Asynchronous APIs
@@ -956,98 +940,35 @@ The workshop takes you through all of the key concepts using a React consumer an
956
940
  - [Asynchronous messages](https://github.com/pact-foundation/pact-js/tree/master/examples/messages)
957
941
  - [Serverless](https://github.com/pact-foundation/pact-js/tree/master/examples/serverless)
958
942
 
959
- ## Using Pact in non-Node environments
943
+ ## Using Pact in non-Node environments such as Karma
960
944
 
961
945
  Pact requires a Node runtime to be able to start and stop Mock servers, write logs and other things.
962
946
 
963
947
  However, when used within browser or non-Node based environments - such as with Karma or ng-test - this is not possible.
964
948
 
965
- To address this challenge, we have released a separate 'web' based module for this purpose - `pact-web`.
966
- Whilst it still provides a testing DSL, it cannot start and stop mock servers as per the `pact`
967
- package, so you will need to coordinate this yourself prior to and after executing any tests.
968
-
969
- To get started, install `pact-web` and [Pact Node](https://github.com/pact-foundation/pact-node):
970
-
971
- npm install --save-dev @pact-foundation/pact-web @pact-foundation/pact-node
972
-
973
- If you're not using Karma, you can start and stop the mock server using [Pact Node](https://github.com/pact-foundation/pact-node) or something like [Grunt Pact](https://github.com/pact-foundation/grunt-pact).
974
-
975
- ### Using Pact with Karma
976
-
977
- We have create a [plugin](https://github.com/pact-foundation/karma-pact) for Karma,
978
- which will automatically start and stop any Mock Server for your Pact tests.
979
-
980
- Modify your `karma.conf.js` file as per below to get started:
981
-
982
- ```js
983
- // Load pact framework - this will start/stop mock server automatically
984
- frameworks: ['pact'],
985
-
986
- // Load the pact and default karma plugins
987
- plugins: [
988
- 'karma-*',
989
- '@pact-foundation/karma-pact'
990
- ],
991
-
992
- // load pact web module
993
- files: [
994
- 'node_modules/@pact-foundation/pact-web/pact-web.js',
995
- ...
996
- ],
997
-
998
- // Configure the mock service
999
- pact: [{
1000
- port: 1234,
1001
- consumer: 'KarmaMochaConsumer',
1002
- provider: 'KarmaMochaProvider',
1003
- logLevel: 'DEBUG',
1004
- log: path.resolve(process.cwd(), 'logs', 'pact.log'),
1005
- dir: path.resolve(process.cwd(), 'pacts')
1006
- }],
1007
- ```
1008
-
1009
- Check out the [Examples](#examples) for how to use the Karma interface.
1010
-
1011
- ### Using Pact with RequireJS
1012
-
1013
- The module name should be "Pact" - not "pact-js". An example config with a karma test might look
1014
- like the following:
1015
-
1016
- In `client-spec.js` change the `define` to:
1017
-
1018
- ```js
1019
- define(['client', 'Pact'], function (example, Pact) {
1020
- ```
1021
-
1022
- In `test-main.js`:
1023
-
1024
- ```js
1025
- require.config({
1026
- baseUrl: "/base",
1027
- paths: {
1028
- Pact: "node_modules/pact-web/pact-web",
1029
- client: "js/client",
1030
- },
1031
- deps: allTestFiles,
1032
- callback: window.__karma__.start,
1033
- })
1034
- ```
1035
-
1036
- See this [Stack Overflow](https://stackoverflow.com/a/44170373/1008568) question for background, and
1037
- this [gist](https://gist.github.com/mefellows/15c9fcb052c2aa9d8951f91d48d6da54) with a working example.
949
+ You will need a Node based test framework such as Jest or Mocha.
1038
950
 
1039
951
  ## Pact JS V3
1040
952
 
1041
- An initial alpha version of Pact-JS with support for V3 specification features and XML matching has
953
+ An initial beta version of Pact-JS with support for V3 specification features and XML matching has
1042
954
  been released. Current support is for Node 10, 12 and 14. Thanks to the folks at [Align Tech](https://www.aligntech.com/) for sponsoring this work.
1043
955
 
1044
956
  To install it:
1045
957
 
1046
- ```console
1047
- npm i @pact-foundation/pact@beta
958
+ NPM
959
+ ```sh
960
+ npm install --save-dev @pact-foundation/pact@beta
961
+ ```
962
+
963
+ Yarn
964
+
965
+ ```sh
966
+ yarn add --dev @pact-foundation/pact@beta
1048
967
  ```
1049
968
 
1050
- For examples on how to use it, see [examples/v3/e2e](https://github.com/pact-foundation/pact-js/tree/feat/v3.0.0/examples/v3/e2e) and [examples/v3/todo-consumer](https://github.com/pact-foundation/pact-js/tree/feat/v3.0.0/examples/v3/todo-consumer) in the `v3.0.0` branch.
969
+ - Ensure you install the package as `devDependencies` by using [`--save-dev`][npm-devdep]/[`--dev`][yarn-devdep] ;
970
+ - Make sure the `ignore-scripts` option is disabled, pact uses npm scripts to download further dependencies.
971
+ - For examples on how to use it, see [examples/v3/e2e](https://github.com/pact-foundation/pact-js/tree/feat/v3.0.0/examples/v3/e2e) and [examples/v3/todo-consumer](https://github.com/pact-foundation/pact-js/tree/feat/v3.0.0/examples/v3/todo-consumer) in the `v3.0.0` branch.
1051
972
 
1052
973
  **NOTE: The API of this implementation is likely to change. See this [discussion](https://github.com/pact-foundation/pact-js/discussions/681) for more**
1053
974
 
@@ -1120,7 +1041,7 @@ There is an `XmlBuilder` class that provides a DSL to help construct XML bodies
1120
1041
  for example:
1121
1042
 
1122
1043
  ```javascript
1123
- body: new XmlBuilder("1.0", "UTF-8", "ns1:projects").build(el => {
1044
+ body: new XmlBuilder("1.0", "UTF-8", "ns1:projects").build((el) => {
1124
1045
  el.setAttributes({
1125
1046
  id: "1234",
1126
1047
  "xmlns:ns1": "http://some.namespace/and/more/stuff",
@@ -1133,8 +1054,8 @@ body: new XmlBuilder("1.0", "UTF-8", "ns1:projects").build(el => {
1133
1054
  name: string("Project 1"),
1134
1055
  due: timestamp("yyyy-MM-dd'T'HH:mm:ss.SZ", "2016-02-11T09:46:56.023Z"),
1135
1056
  },
1136
- project => {
1137
- project.appendElement("ns1:tasks", {}, task => {
1057
+ (project) => {
1058
+ project.appendElement("ns1:tasks", {}, (task) => {
1138
1059
  task.eachLike(
1139
1060
  "ns1:task",
1140
1061
  {
@@ -1232,6 +1153,33 @@ Try starting the mock service manually and seeing if it comes up. When submittin
1232
1153
 
1233
1154
  If you are having issues, a good place to start is setting `logLevel: 'debug'` when configuring the `new Pact({...})` object. This will give you detailed in/out requests as far as Pact sees them during verification.
1234
1155
 
1156
+ ### Actual interactions do not match expected interactions for mock MockService.
1157
+
1158
+ If you see an error that looks like this:
1159
+
1160
+ ```
1161
+ console.error
1162
+ Pact verification failed!
1163
+
1164
+ at node_modules/@pact-foundation/src/httpPact.ts:152:17
1165
+
1166
+ console.error
1167
+ Actual interactions do not match expected interactions for mock MockService.
1168
+
1169
+ Missing requests:
1170
+ GET http://127.0.0.1:3001/some/path
1171
+ ```
1172
+
1173
+ It means your API client code being tested, is not sending the request to the mock service configured by Pact. Pact does not automatically mock your API calls - you need to ensure your API client is correctly configured to poitn at the Pact mock service.
1174
+
1175
+ Given you have constructed a Pact object with name `provider` and you are using a `DogApiClient` class to send requests to your `Dog Service`, you can dynamically configure your API client as follows:
1176
+
1177
+ ```
1178
+ provider.setup().then(opts => {
1179
+ dogService = new DogApiClient({ `http://${opts.host}`, port: opts.port })
1180
+ })
1181
+ ```
1182
+
1235
1183
  ### Corporate Proxies / Firewalls
1236
1184
 
1237
1185
  If you're on a corporate machine, it's common for all network calls to route through a proxy - even requests that go to your own machine!
@@ -1240,9 +1188,10 @@ The symptom presents as follows:
1240
1188
 
1241
1189
  1. The mock server starts up correctly, as shown by a debug level log message such as this:
1242
1190
 
1243
- ```
1244
- [2021-11-22 11:16:01.214 +0000] DEBUG (3863 on Matts-iMac): pact-core@11.0.1: INFO WEBrick::HTTPServer#start: pid=3864 port=50337
1245
- ```
1191
+ ```
1192
+ [2021-11-22 11:16:01.214 +0000] DEBUG (3863 on Matts-iMac): pact-core@11.0.1: INFO WEBrick::HTTPServer#start: pid=3864 port=50337
1193
+ ```
1194
+
1246
1195
  2. You receive a conflicting message such as "The pact mock service doesn't appear to be running" and the tests never run or any before all blocks fail to complete.
1247
1196
 
1248
1197
  The problem is that the Pact framework attempts to ensure the mock service can be communicated with before the tests run. It does so via an HTTP call, which will be sent via any intermediate proxies if configured. The proxy is unlikely to know how send the request back to your machine, which results in a timeout or error.
@@ -1415,8 +1364,6 @@ You'll need to add the additional header `Access-Control-Expose-Headers`, this w
1415
1364
 
1416
1365
  See [this issue](https://github.com/angular/angular/issues/13554) for background.
1417
1366
 
1418
-
1419
-
1420
1367
  ## Contributing
1421
1368
 
1422
1369
  1. Fork it
@@ -1440,3 +1387,5 @@ or chat to us at
1440
1387
  [spec]: https://github.com/pact-foundation/pact-specification
1441
1388
  [changelog]: https://github.com/pact-foundation/pact-js/blob/master/CHANGELOG.md
1442
1389
  [pactflow]: https://pactflow.io
1390
+ [npm-devdep]: https://docs.npmjs.com/cli/v8/commands/npm-install
1391
+ [yarn-devdep]: https://classic.yarnpkg.com/en/docs/cli/add#toc-yarn-add-dev-d
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@pact-foundation/pact",
3
- "version": "9.17.2",
3
+ "version": "9.18.1",
4
4
  "description": "Pact for all things Javascript",
5
5
  "main": "./src/pact.js",
6
6
  "types": "./src/pact.d.ts",
7
7
  "scripts": {
8
8
  "clean": "rimraf docs dist dist-web coverage .nyc_output logs pacts",
9
9
  "coverage": "nyc report --reporter=lcov",
10
- "dist": "tsc && webpack --config ./config/webpack.web.config.js && copyfiles package.json ./dist",
10
+ "dist": "tsc && copyfiles package.json ./dist",
11
11
  "lint": "tslint -c tslint.json '{src,test,examples}/**/*.ts' -e '**/node_modules/**/*.ts'",
12
12
  "lint:fix": "npm run lint -- --fix",
13
13
  "format:base": "prettier \"{src,test,examples}/**/*.{ts,js}\"",
@@ -16,8 +16,7 @@
16
16
  "postdist": "npm test",
17
17
  "predist": "npm run clean && npm run format:check && npm run lint",
18
18
  "release": "standard-version",
19
- "test": "nyc --check-coverage --reporter=html --reporter=text-summary mocha",
20
- "webpack": "webpack --config ./config/webpack.web.config.js"
19
+ "test": "nyc --check-coverage --reporter=html --reporter=text-summary mocha"
21
20
  },
22
21
  "repository": {
23
22
  "type": "git",
@@ -94,9 +93,11 @@
94
93
  ]
95
94
  },
96
95
  "dependencies": {
97
- "@pact-foundation/pact-node": "^10.15.0",
96
+ "@pact-foundation/pact-node": "^10.17.2",
98
97
  "@types/bluebird": "^3.5.20",
99
98
  "@types/express": "^4.17.11",
99
+ "@types/http-proxy": "^1.17.9",
100
+ "axios": "^0.27.2",
100
101
  "bluebird": "~3.5.1",
101
102
  "body-parser": "^1.18.2",
102
103
  "cli-color": "^1.1.0",
@@ -115,7 +116,8 @@
115
116
  "pino": "^6.5.1",
116
117
  "pino-pretty": "^4.1.0",
117
118
  "pkginfo": "^0.4.1",
118
- "popsicle": "^9.2.0"
119
+ "ramda": "^0.27.2",
120
+ "randexp": "^0.5.3"
119
121
  },
120
122
  "devDependencies": {
121
123
  "@babel/cli": "^7.14.5",
@@ -170,8 +172,6 @@
170
172
  "ts-node": "^3.3.0",
171
173
  "tslint": "^5.11.0",
172
174
  "tslint-config-prettier": "^1.15.0",
173
- "typescript": "^3.3.3",
174
- "webpack": "^4.45.0",
175
- "webpack-cli": "^4.3.1"
175
+ "typescript": "^3.3.3"
176
176
  }
177
177
  }
@@ -1,5 +1,5 @@
1
1
  import pino = require("pino");
2
2
  declare const logger: pino.Logger;
3
- export declare const setLogLevel: (wantedLevel?: number | "error" | "debug" | "info" | "warn" | "fatal" | "trace" | undefined) => number | void;
3
+ export declare const setLogLevel: (wantedLevel?: number | "error" | "fatal" | "warn" | "info" | "debug" | "trace" | undefined) => number | void;
4
4
  export declare const traceHttpInteractions: () => void;
5
5
  export default logger;
@@ -17,6 +17,5 @@ export declare enum HTTPMethod {
17
17
  }
18
18
  export declare type methods = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS" | "COPY" | "LOCK" | "MKCOL" | "MOVE" | "PROPFIND" | "PROPPATCH" | "UNLOCK" | "REPORT";
19
19
  export declare class Request {
20
- private readonly transport;
21
- send(method: HTTPMethod | methods, url: string, body?: string): Promise<string>;
20
+ send(method: HTTPMethod, url: string, body?: string): Promise<string>;
22
21
  }
@@ -1,9 +1,45 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
2
38
  Object.defineProperty(exports, "__esModule", { value: true });
3
39
  exports.Request = exports.HTTPMethod = void 0;
4
- // Polyfill Object.assign since it's missing in Popsicle
5
- require("es6-object-assign").polyfill();
6
- var Popsicle = require("popsicle/dist/common");
40
+ var axios_1 = require("axios");
41
+ var https = require("https");
42
+ var logger_1 = require("./logger");
7
43
  var HTTPMethod;
8
44
  (function (HTTPMethod) {
9
45
  HTTPMethod["GET"] = "GET";
@@ -24,31 +60,42 @@ var HTTPMethod;
24
60
  })(HTTPMethod = exports.HTTPMethod || (exports.HTTPMethod = {}));
25
61
  var Request = /** @class */ (function () {
26
62
  function Request() {
27
- this.transport = Popsicle.createTransport({
28
- maxBufferSize: Infinity,
29
- rejectUnauthorized: false,
30
- type: "text",
31
- });
32
63
  }
33
64
  Request.prototype.send = function (method, url, body) {
34
- var opts = {
35
- body: body,
36
- headers: {
37
- "Content-Type": "application/json",
38
- "X-Pact-Mock-Service": "true",
39
- },
40
- method: method,
41
- timeout: 10000,
42
- transport: this.transport,
43
- url: url,
44
- };
45
- return Popsicle.request(opts).then(function (res) {
46
- if (res.status >= 200 && res.status < 400) {
47
- return res.body;
48
- }
49
- else {
50
- return Promise.reject(res.body);
51
- }
65
+ return __awaiter(this, void 0, void 0, function () {
66
+ var res, e_1;
67
+ return __generator(this, function (_a) {
68
+ switch (_a.label) {
69
+ case 0:
70
+ _a.trys.push([0, 2, , 3]);
71
+ return [4 /*yield*/, axios_1.default(url, {
72
+ data: body,
73
+ headers: {
74
+ "Content-Type": "application/json",
75
+ "X-Pact-Mock-Service": "true",
76
+ },
77
+ httpsAgent: new https.Agent({
78
+ keepAlive: true,
79
+ rejectUnauthorized: false,
80
+ }),
81
+ method: method,
82
+ timeout: 10000,
83
+ url: url,
84
+ maxBodyLength: Infinity,
85
+ })];
86
+ case 1:
87
+ res = _a.sent();
88
+ if (res.status >= 200 && res.status < 400) {
89
+ return [2 /*return*/, res.data];
90
+ }
91
+ return [2 /*return*/, Promise.reject(res.data)];
92
+ case 2:
93
+ e_1 = _a.sent();
94
+ logger_1.default.error("error making http request: " + e_1.message);
95
+ return [2 /*return*/, Promise.reject(e_1.response && e_1.response.data ? e_1.response.data : e_1.message)];
96
+ case 3: return [2 /*return*/];
97
+ }
98
+ });
52
99
  });
53
100
  };
54
101
  return Request;
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/common/request.ts"],"names":[],"mappings":";;;AAAA,wDAAwD;AACxD,OAAO,CAAC,mBAAmB,CAAC,CAAC,QAAQ,EAAE,CAAA;AAEvC,+CAAgD;AAGhD,IAAY,UAgBX;AAhBD,WAAY,UAAU;IACpB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,6BAAe,CAAA;IACf,+BAAiB,CAAA;IACjB,2BAAa,CAAA;IACb,iCAAmB,CAAA;IACnB,2BAAa,CAAA;IACb,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,2BAAa,CAAA;IACb,mCAAqB,CAAA;IACrB,qCAAuB,CAAA;IACvB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;AACnB,CAAC,EAhBW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAgBrB;AAmBD;IAAA;QACmB,cAAS,GAAG,QAAQ,CAAC,eAAe,CAAC;YACpD,aAAa,EAAE,QAAQ;YACvB,kBAAkB,EAAE,KAAK;YACzB,IAAI,EAAE,MAAM;SACb,CAAC,CAAA;IA0BJ,CAAC;IAzBQ,sBAAI,GAAX,UACE,MAA4B,EAC5B,GAAW,EACX,IAAa;QAEb,IAAM,IAAI,GAAG;YACX,IAAI,MAAA;YACJ,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,qBAAqB,EAAE,MAAM;aAC9B;YACD,MAAM,QAAA;YACN,OAAO,EAAE,KAAK;YACd,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,GAAG,KAAA;SACJ,CAAA;QAED,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAC,GAAa;YAC/C,IAAI,GAAG,CAAC,MAAM,IAA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,QAAQ;6BACxB,CAAC,EAAA;;wBAdI,GAAG,GAAG,SAcV;wBAEF,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE;4BACzC,sBAAO,GAAG,CAAC,IAAI,EAAA;yBAChB;wBACD,sBAAO,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAA;;;wBAE/B,gBAAM,CAAC,KAAK,CAAC,gCAA8B,GAAC,CAAC,OAAS,CAAC,CAAA;wBACvD,sBAAO,OAAO,CAAC,MAAM,CACnB,GAAC,CAAC,QAAQ,IAAI,GAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,GAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,GAAC,CAAC,OAAO,CAC5D,EAAA;;;;;KAEJ;IACH,cAAC;AAAD,CAAC,AAlCD,IAkCC;AAlCY,0BAAO"}
@@ -34,6 +34,7 @@ export declare class Verifier {
34
34
  private waitForServerReady;
35
35
  private startProxy;
36
36
  private createProxy;
37
+ private parseBody;
37
38
  private createProxyStateHandler;
38
39
  private registerBeforeHook;
39
40
  private registerAfterHook;
@@ -130,8 +130,15 @@ var Verifier = /** @class */ (function () {
130
130
  var _this = this;
131
131
  var app = express();
132
132
  var proxy = new HttpProxy();
133
- app.use(this.stateSetupPath, bodyParser.json());
134
- app.use(this.stateSetupPath, bodyParser.urlencoded({ extended: true }));
133
+ app.use(bodyParser.json({
134
+ type: [
135
+ "application/json",
136
+ "application/json; charset=utf-8",
137
+ "application/json; charset=utf8",
138
+ ],
139
+ }));
140
+ app.use(bodyParser.urlencoded({ extended: true }));
141
+ app.use("/*", bodyParser.raw({ type: "*/*" }));
135
142
  this.registerBeforeHook(app);
136
143
  this.registerAfterHook(app);
137
144
  // Trace req/res logging
@@ -148,15 +155,34 @@ var Verifier = /** @class */ (function () {
148
155
  app.post(this.stateSetupPath, this.createProxyStateHandler());
149
156
  // Proxy server will respond to Verifier process
150
157
  app.all("/*", function (req, res) {
151
- logger_1.default.debug("Proxing", req.path);
158
+ logger_1.default.debug("Proxing", req.method, req.path);
152
159
  proxy.web(req, res, {
153
160
  changeOrigin: _this.config.changeOrigin === true,
154
161
  secure: _this.config.validateSSL === true,
155
162
  target: _this.config.providerBaseUrl,
156
163
  });
157
164
  });
165
+ proxy.on("proxyReq", function (proxyReq, req) {
166
+ _this.parseBody(proxyReq, req);
167
+ });
158
168
  return app;
159
169
  };
170
+ Verifier.prototype.parseBody = function (proxyReq, req) {
171
+ if (!req.body || !Object.keys(req.body).length) {
172
+ return;
173
+ }
174
+ var bodyData;
175
+ if (Buffer.isBuffer(req.body)) {
176
+ bodyData = req.body;
177
+ }
178
+ else if (typeof req.body === "object") {
179
+ bodyData = JSON.stringify(req.body);
180
+ }
181
+ if (bodyData) {
182
+ proxyReq.setHeader("Content-Length", Buffer.byteLength(bodyData));
183
+ proxyReq.write(bodyData);
184
+ }
185
+ };
160
186
  Verifier.prototype.createProxyStateHandler = function () {
161
187
  var _this = this;
162
188
  return function (req, res) {
@@ -231,7 +257,7 @@ var Verifier = /** @class */ (function () {
231
257
  };
232
258
  Verifier.prototype.createRequestTracer = function () {
233
259
  return function (req, _, next) {
234
- logger_1.default.trace("incoming request", removeEmptyRequestProperties(req));
260
+ logger_1.default.debug("incoming request", removeEmptyRequestProperties(req));
235
261
  next();
236
262
  };
237
263
  };
@@ -248,7 +274,7 @@ var Verifier = /** @class */ (function () {
248
274
  chunks.push(Buffer.from(chunk));
249
275
  }
250
276
  var body = Buffer.concat(chunks).toString("utf8");
251
- logger_1.default.trace("outgoing response", removeEmptyResponseProperties(body, res));
277
+ logger_1.default.debug("outgoing response", removeEmptyResponseProperties(body, res));
252
278
  oldEnd.apply(res, [chunk]);
253
279
  };
254
280
  if (typeof next === "function") {
@@ -1 +1 @@
1
- {"version":3,"file":"verifier.js","sourceRoot":"","sources":["../../../src/dsl/verifier.ts"],"names":[],"mappings":";;;;;;;;;;;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iBAAQ,CACT;AAdD,CAcC,CAAA"}
@@ -54,6 +54,7 @@ var sinon = require("sinon");
54
54
  var verifier_1 = require("./verifier");
55
55
  var pact_node_1 = require("@pact-foundation/pact-node");
56
56
  var logger_1 = require("../common/logger");
57
+ var http = require("http");
57
58
  var express = require("express");
58
59
  chai.use(chaiAsPromised);
59
60
  var expect = chai.expect;
@@ -136,6 +137,63 @@ describe("Verifier", function () {
136
137
  });
137
138
  });
138
139
  });
140
+ describe("#parseBody", function () {
141
+ var proxyReq;
142
+ beforeEach(function () {
143
+ v = new verifier_1.Verifier(opts);
144
+ proxyReq = sinon.createStubInstance(http.ClientRequest);
145
+ });
146
+ describe("when request body exists", function () {
147
+ it("it writes the request if the body is a buffer", function () { return __awaiter(void 0, void 0, void 0, function () {
148
+ var req;
149
+ return __generator(this, function (_a) {
150
+ switch (_a.label) {
151
+ case 0:
152
+ req = { body: "" };
153
+ req.body = Buffer.from("foo");
154
+ return [4 /*yield*/, v["parseBody"](proxyReq, req)];
155
+ case 1:
156
+ _a.sent();
157
+ expect(proxyReq.setHeader).to.have.been.called;
158
+ expect(proxyReq.write).to.have.been.called;
159
+ return [2 /*return*/];
160
+ }
161
+ });
162
+ }); });
163
+ it("it writes the request if the body is an object", function () { return __awaiter(void 0, void 0, void 0, function () {
164
+ var req;
165
+ return __generator(this, function (_a) {
166
+ switch (_a.label) {
167
+ case 0:
168
+ req = { body: { foo: "bar" } };
169
+ return [4 /*yield*/, v["parseBody"](proxyReq, req)];
170
+ case 1:
171
+ _a.sent();
172
+ expect(proxyReq.setHeader).to.have.been.called;
173
+ expect(proxyReq.write).to.have.been.called;
174
+ return [2 /*return*/];
175
+ }
176
+ });
177
+ }); });
178
+ });
179
+ describe("when request body does not exist", function () {
180
+ it("it does not invoke the request rewrite", function () { return __awaiter(void 0, void 0, void 0, function () {
181
+ var req;
182
+ return __generator(this, function (_a) {
183
+ switch (_a.label) {
184
+ case 0:
185
+ req = "foo";
186
+ return [4 /*yield*/, v["parseBody"](proxyReq, req)];
187
+ case 1:
188
+ _a.sent();
189
+ expect(proxyReq.setHeader).to.have.not.been.called;
190
+ expect(proxyReq.write).to.have.not.been.called;
191
+ return [2 /*return*/];
192
+ }
193
+ });
194
+ }); });
195
+ });
196
+ });
139
197
  describe("#setupStates", function () {
140
198
  describe("when there are provider states on the pact", function () {
141
199
  describe("and there are handlers associated with those states", function () {
@@ -1 +1 @@
1
- {"version":3,"file":"verifier.spec.js","sourceRoot":"","sources":["../../../src/dsl/verifier.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mEAAmE;AACnE,2BAA4B;AAC5B,iDAAkD;AAClD,6BAA8B;AAC9B,uCAAsD;AACtD,wDAAuD;AACvD,2CAAqC;AAErC,iCAAkC;AAElC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;AAExB,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;AAE1B,QAAQ,CAAC,UAAU,EAAE;IACnB,SAAS,CAAC;QACR,KAAK,CAAC,OAAO,EAAE,CAAA;IACjB,CAAC,CAAC,CAAA;IAEF,IAAM,KAAK,GAAG,cAAc,CAAA;IAC5B,IAAI,CAAW,CAAA;IACf,IAAI,IAAqB,CAAA;IACzB,IAAI,QAAiB,CAAA;IACrB,IAAM,eAAe,GAAG,mBAAmB,CAAA;IAE3C,+CAA+C;IAC/C,IAAM,UAAU,GAAG,UAAC,KAAa,IAAK,OAAA,CAAC;QACrC,EAAE,EAAE,UAAC,eAAuB,EAAE,EAAO;YACnC,IAAI,eAAe,KAAK,KAAK,EAAE;gBAC7B,EAAE,EAAE,CAAA;aACL;QACH,CAAC;KACF,CAAC,EANoC,CAMpC,CAAA;IAEF,UAAU,CAAC;;QACT,QAAQ,GAAG,KAAK,CAAA;QAChB,IAAI,GAAG;YACL,eAAe,iBAAA;YACf,aAAa,EAAE,UAAC,GAAG,EAAE,GAAG,EAAE,IAAI;gBAC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,GAAG,IAAI,mBAAQ,EAAE,CAAA;QAElB,EAAE,CAAC,4BAA4B,EAAE;YAC/B,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,CAAA;QAC5B,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
package/src/httpPact.js CHANGED
@@ -46,6 +46,9 @@ var Pact = /** @class */ (function () {
46
46
  if (lodash_1.isEmpty(this.opts.provider)) {
47
47
  throw new configurationError_1.default("You must specify a Provider for this pact.");
48
48
  }
49
+ if (this.opts.spec !== 2) {
50
+ throw new configurationError_1.default("Pact-js currently only supports pact spec version 2. If you need a higher version of the pact specification, you can try the beta. See instructions here: https://github.com/pact-foundation/pact-js#pact-js-v3");
51
+ }
49
52
  logger_1.setLogLevel(this.opts.logLevel);
50
53
  pact_node_1.default.logLevel(this.opts.logLevel);
51
54
  if (this.opts.logLevel === "trace") {
@@ -1 +1 @@
1
- {"version":3,"file":"httpPact.js","sourceRoot":"","sources":["../../src/httpPact.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,wDAAuD;AACvD,2BAA4B;AAC5B,+BAAgC;AAChC,iCAAkC;AAClC,iDAAkE;AAClE,iCAAgC;AAChC,oCAA8C;AAC9C,0CAA4E;AAC5E,iDAA+C;AAG/C,gEAA0D;AAC1D,kEAA4D;AAE5D,IAAM,oBAAoB,GAAG;IAC3B,gBAAM,CAAC,KAAK,CACV,sDAAsD;QACpD,6FAA6F;QAC7F,gIAAgI;QAChI,uIAAuI;QACvI,+FAA+F,CAClG,CAAA;AACH,CAAC,CAAA;AAED;;;;;;GAMG;AACH;IAyBE,cAAY,MAAmB;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,CAAA;QAElD,IAAI,gBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YAC/B,MAAM,IAAI,4BAAkB,CAAC,4CAA4C,CAAC,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@ -51,6 +51,9 @@ var PactWeb = /** @class */ (function () {
51
51
  ssl: false,
52
52
  };
53
53
  this.opts = __assign(__assign({}, defaults), config);
54
+ if (this.opts.spec !== 2) {
55
+ throw new Error("Pact-web only supports pact spec version 2");
56
+ }
54
57
  console.info("Setting up Pact using mock service on port: \"" + this.opts.port + "\"");
55
58
  this.mockService = new mockService_1.MockService(this.opts.consumer, this.opts.provider, this.opts.port, this.opts.host, this.opts.ssl, this.opts.pactfileWriteMode);
56
59
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pact-web.js","sourceRoot":"","sources":["../../src/pact-web.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,4BAA4B;AAC5B;;;GAGG;AACH,2CAAsC;AAEtC,iDAAkE;AAClE,iDAAkE;AAElE,gEAA0D;AAC1D,sBAAQ,EAAE,CAAA;AAwCV;;;;;;;GAOG;AACH;IAKE,iBAAY,MAAuB;QACjC,IAAM,QAAQ,GAAG;YACf,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,WAAW;YACjB,iBAAiB,EAAE,WAAW;YAC9B,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,CAAC;YACP,GAAG,EAAE,KAAK;SACI,CAAA;QAEhB,IAAI,CAAC,IAAI,GAAG,sBAAK,QAAQ,GAAK,MAAM,CAA4B,CAAA;QAEhE,OAAO,CAAC,IAAI,CACV,mDAAgD,IAAI,CAAC,IAAI,CAAC,IAAI,OAAG,CAClE,CAAA;QAED,IAAI,CAAC,WAAW,GAAG,IAAI,yBAAW,CAChC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAClB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAClB,IAAI,CAAC,IAAI,CAAC,IAAI,EACd,IAAI,CAAC,IAAI,CAAC,IAAI,EACd,IAAI,CAAC,IAAI,CAAC,GAAG,EACb,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAC5B,CAAA;IACH,CAAC;IAED;;;;;;OAMG;IACI,gCAAc,GA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