@pact-foundation/pact 16.3.0 → 16.4.0
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 +16 -3
- package/CONTRIBUTING.md +2 -2
- package/README.md +6 -2
- package/package.json +25 -28
- package/src/common/graphQL/configurationError.js +2 -22
- package/src/common/graphQL/configurationError.js.map +1 -1
- package/src/common/graphQL/graphQL.d.ts +2 -2
- package/src/common/graphQL/graphQL.js +11 -14
- package/src/common/graphQL/graphQL.js.map +1 -1
- package/src/common/graphQL/graphQLQueryError.js +2 -22
- package/src/common/graphQL/graphQLQueryError.js.map +1 -1
- package/src/common/logger.js +9 -9
- package/src/common/logger.js.map +1 -1
- package/src/common/matchingRules.d.ts +1 -1
- package/src/common/matchingRules.js +21 -21
- package/src/common/matchingRules.js.map +1 -1
- package/src/common/net.js +36 -42
- package/src/common/net.js.map +1 -1
- package/src/common/net.spec.js +41 -53
- package/src/common/net.spec.js.map +1 -1
- package/src/common/request.js +33 -82
- package/src/common/request.js.map +1 -1
- package/src/common/request.spec.js +26 -26
- package/src/common/request.spec.js.map +1 -1
- package/src/common/spec.js +3 -4
- package/src/common/spec.js.map +1 -1
- package/src/dsl/apolloGraphql.js +7 -25
- package/src/dsl/apolloGraphql.js.map +1 -1
- package/src/dsl/apolloGraphql.spec.js +21 -18
- package/src/dsl/apolloGraphql.spec.js.map +1 -1
- package/src/dsl/graphql.d.ts +2 -2
- package/src/dsl/graphql.js +29 -48
- package/src/dsl/graphql.js.map +1 -1
- package/src/dsl/graphql.spec.js +81 -66
- package/src/dsl/graphql.spec.js.map +1 -1
- package/src/dsl/interaction.d.ts +2 -2
- package/src/dsl/interaction.js +41 -48
- package/src/dsl/interaction.js.map +1 -1
- package/src/dsl/interaction.spec.js +77 -70
- package/src/dsl/interaction.spec.js.map +1 -1
- package/src/dsl/matchers.d.ts +1 -1
- package/src/dsl/matchers.js +19 -31
- package/src/dsl/matchers.js.map +1 -1
- package/src/dsl/matchers.spec.js +199 -208
- package/src/dsl/matchers.spec.js.map +1 -1
- package/src/dsl/message.d.ts +3 -3
- package/src/dsl/options.d.ts +3 -3
- package/src/dsl/verifier/proxy/hooks.d.ts +2 -2
- package/src/dsl/verifier/proxy/hooks.js +42 -112
- package/src/dsl/verifier/proxy/hooks.js.map +1 -1
- package/src/dsl/verifier/proxy/hooks.spec.js +84 -199
- package/src/dsl/verifier/proxy/hooks.spec.js.map +1 -1
- package/src/dsl/verifier/proxy/messages.d.ts +2 -2
- package/src/dsl/verifier/proxy/messages.js +88 -106
- package/src/dsl/verifier/proxy/messages.js.map +1 -1
- package/src/dsl/verifier/proxy/parseBody.d.ts +1 -1
- package/src/dsl/verifier/proxy/parseBody.js +2 -2
- package/src/dsl/verifier/proxy/parseBody.js.map +1 -1
- package/src/dsl/verifier/proxy/parseBody.spec.js +31 -76
- package/src/dsl/verifier/proxy/parseBody.spec.js.map +1 -1
- package/src/dsl/verifier/proxy/proxy.d.ts +2 -2
- package/src/dsl/verifier/proxy/proxy.js +22 -26
- package/src/dsl/verifier/proxy/proxy.js.map +1 -1
- package/src/dsl/verifier/proxy/proxy.spec.js +14 -14
- package/src/dsl/verifier/proxy/proxy.spec.js.map +1 -1
- package/src/dsl/verifier/proxy/proxyRequest.d.ts +3 -3
- package/src/dsl/verifier/proxy/proxyRequest.js +7 -7
- package/src/dsl/verifier/proxy/proxyRequest.js.map +1 -1
- package/src/dsl/verifier/proxy/proxyRequest.spec.js +49 -64
- package/src/dsl/verifier/proxy/proxyRequest.spec.js.map +1 -1
- package/src/dsl/verifier/proxy/stateHandler/setupStates.d.ts +3 -3
- package/src/dsl/verifier/proxy/stateHandler/setupStates.js +14 -18
- package/src/dsl/verifier/proxy/stateHandler/setupStates.js.map +1 -1
- package/src/dsl/verifier/proxy/stateHandler/setupStates.spec.js +76 -159
- package/src/dsl/verifier/proxy/stateHandler/setupStates.spec.js.map +1 -1
- package/src/dsl/verifier/proxy/stateHandler/stateHandler.d.ts +2 -2
- package/src/dsl/verifier/proxy/stateHandler/stateHandler.js +23 -72
- package/src/dsl/verifier/proxy/stateHandler/stateHandler.js.map +1 -1
- package/src/dsl/verifier/proxy/stateHandler/stateHandler.spec.js +37 -85
- package/src/dsl/verifier/proxy/stateHandler/stateHandler.spec.js.map +1 -1
- package/src/dsl/verifier/proxy/tracer.d.ts +1 -1
- package/src/dsl/verifier/proxy/tracer.js +42 -35
- package/src/dsl/verifier/proxy/tracer.js.map +1 -1
- package/src/dsl/verifier/proxy/types.d.ts +5 -5
- package/src/dsl/verifier/types.d.ts +3 -3
- package/src/dsl/verifier/verifier.d.ts +1 -1
- package/src/dsl/verifier/verifier.js +49 -56
- package/src/dsl/verifier/verifier.js.map +1 -1
- package/src/dsl/verifier/verifier.spec.js +76 -93
- package/src/dsl/verifier/verifier.spec.js.map +1 -1
- package/src/errors/configurationError.js +2 -22
- package/src/errors/configurationError.js.map +1 -1
- package/src/errors/graphQLQueryError.js +2 -22
- package/src/errors/graphQLQueryError.js.map +1 -1
- package/src/errors/matcherError.js +2 -22
- package/src/errors/matcherError.js.map +1 -1
- package/src/errors/verificationError.js +2 -22
- package/src/errors/verificationError.js.map +1 -1
- package/src/httpPact/ffi.d.ts +2 -2
- package/src/httpPact/ffi.js +28 -29
- package/src/httpPact/ffi.js.map +1 -1
- package/src/httpPact/ffi.spec.js +30 -31
- package/src/httpPact/ffi.spec.js.map +1 -1
- package/src/httpPact/index.d.ts +3 -3
- package/src/httpPact/index.js +92 -149
- package/src/httpPact/index.js.map +1 -1
- package/src/httpPact/index.spec.js +75 -125
- package/src/httpPact/index.spec.js.map +1 -1
- package/src/httpPact/tracing.js +20 -28
- package/src/httpPact/tracing.js.map +1 -1
- package/src/index.js +1 -1
- package/src/index.js.map +1 -1
- package/src/messageConsumerPact.d.ts +3 -3
- package/src/messageConsumerPact.js +50 -51
- package/src/messageConsumerPact.js.map +1 -1
- package/src/messageConsumerPact.spec.js +50 -49
- package/src/messageConsumerPact.spec.js.map +1 -1
- package/src/messageProviderPact.d.ts +3 -3
- package/src/messageProviderPact.js +68 -85
- package/src/messageProviderPact.js.map +1 -1
- package/src/messageProviderPact.spec.js +75 -66
- package/src/messageProviderPact.spec.js.map +1 -1
- package/src/pact.integration.spec.js +250 -268
- package/src/pact.integration.spec.js.map +1 -1
- package/src/v3/display.d.ts +1 -1
- package/src/v3/display.js +44 -58
- package/src/v3/display.js.map +1 -1
- package/src/v3/ffi.d.ts +2 -2
- package/src/v3/ffi.js +18 -16
- package/src/v3/ffi.js.map +1 -1
- package/src/v3/ffi.spec.d.ts +1 -0
- package/src/v3/ffi.spec.js +50 -0
- package/src/v3/ffi.spec.js.map +1 -0
- package/src/v3/graphql/graphQL.d.ts +4 -4
- package/src/v3/graphql/graphQL.js +50 -75
- package/src/v3/graphql/graphQL.js.map +1 -1
- package/src/v3/matchers.d.ts +2 -2
- package/src/v3/matchers.js +112 -147
- package/src/v3/matchers.js.map +1 -1
- package/src/v3/matchers.spec.js +168 -187
- package/src/v3/matchers.spec.js.map +1 -1
- package/src/v3/pact.d.ts +2 -2
- package/src/v3/pact.js +103 -151
- package/src/v3/pact.js.map +1 -1
- package/src/v3/types.d.ts +1 -1
- package/src/v3/xml/xmlBuilder.d.ts +1 -3
- package/src/v3/xml/xmlBuilder.js +7 -9
- package/src/v3/xml/xmlBuilder.js.map +1 -1
- package/src/v3/xml/xmlElement.d.ts +2 -2
- package/src/v3/xml/xmlElement.js +24 -41
- package/src/v3/xml/xmlElement.js.map +1 -1
- package/src/v3/xml/xmlElement.spec.js +23 -25
- package/src/v3/xml/xmlElement.spec.js.map +1 -1
- package/src/v3/xml/xmlNode.js +2 -5
- package/src/v3/xml/xmlNode.js.map +1 -1
- package/src/v3/xml/xmlText.d.ts +1 -1
- package/src/v3/xml/xmlText.js +9 -25
- package/src/v3/xml/xmlText.js.map +1 -1
- package/src/v4/graphql/graphQLInteractionWithRequest.d.ts +4 -4
- package/src/v4/graphql/graphQLInteractionWithRequest.js +21 -17
- package/src/v4/graphql/graphQLInteractionWithRequest.js.map +1 -1
- package/src/v4/graphql/graphQLRequestBuilder.d.ts +3 -3
- package/src/v4/graphql/graphQLRequestBuilder.js +18 -20
- package/src/v4/graphql/graphQLRequestBuilder.js.map +1 -1
- package/src/v4/graphql/index.d.ts +6 -6
- package/src/v4/graphql/index.js +21 -17
- package/src/v4/graphql/index.js.map +1 -1
- package/src/v4/graphql/types.d.ts +5 -5
- package/src/v4/http/index.d.ts +2 -2
- package/src/v4/http/index.js +48 -93
- package/src/v4/http/index.js.map +1 -1
- package/src/v4/http/interactionWithCompleteRequest.d.ts +4 -7
- package/src/v4/http/interactionWithCompleteRequest.js +6 -10
- package/src/v4/http/interactionWithCompleteRequest.js.map +1 -1
- package/src/v4/http/interactionWithPlugin.d.ts +3 -3
- package/src/v4/http/interactionWithPlugin.js +14 -11
- package/src/v4/http/interactionWithPlugin.js.map +1 -1
- package/src/v4/http/interactionWithPluginRequest.d.ts +2 -2
- package/src/v4/http/interactionWithPluginRequest.js +11 -8
- package/src/v4/http/interactionWithPluginRequest.js.map +1 -1
- package/src/v4/http/interactionWithPluginResponse.d.ts +2 -2
- package/src/v4/http/interactionWithPluginResponse.js +10 -48
- package/src/v4/http/interactionWithPluginResponse.js.map +1 -1
- package/src/v4/http/interactionWithRequest.d.ts +2 -2
- package/src/v4/http/interactionWithRequest.js +11 -8
- package/src/v4/http/interactionWithRequest.js.map +1 -1
- package/src/v4/http/interactionWithResponse.d.ts +2 -2
- package/src/v4/http/interactionWithResponse.js +10 -48
- package/src/v4/http/interactionWithResponse.js.map +1 -1
- package/src/v4/http/requestBuilder.d.ts +3 -3
- package/src/v4/http/requestBuilder.js +32 -34
- package/src/v4/http/requestBuilder.js.map +1 -1
- package/src/v4/http/requestWithPluginBuilder.d.ts +2 -2
- package/src/v4/http/requestWithPluginBuilder.js +26 -46
- package/src/v4/http/requestWithPluginBuilder.js.map +1 -1
- package/src/v4/http/responseBuilder.d.ts +3 -3
- package/src/v4/http/responseBuilder.js +24 -25
- package/src/v4/http/responseBuilder.js.map +1 -1
- package/src/v4/http/responseWithPluginBuilder.d.ts +1 -1
- package/src/v4/http/responseWithPluginBuilder.js +5 -25
- package/src/v4/http/responseWithPluginBuilder.js.map +1 -1
- package/src/v4/http/types.d.ts +3 -2
- package/src/v4/http/unconfiguredInteraction.d.ts +6 -5
- package/src/v4/http/unconfiguredInteraction.js +31 -26
- package/src/v4/http/unconfiguredInteraction.js.map +1 -1
- package/src/v4/index.d.ts +4 -4
- package/src/v4/index.js +31 -35
- package/src/v4/index.js.map +1 -1
- package/src/v4/message/asynchronousMessage.d.ts +7 -6
- package/src/v4/message/asynchronousMessage.js +157 -190
- package/src/v4/message/asynchronousMessage.js.map +1 -1
- package/src/v4/message/index.d.ts +7 -6
- package/src/v4/message/index.js +188 -217
- package/src/v4/message/index.js.map +1 -1
- package/src/v4/message/types.d.ts +5 -3
- package/src/v4/types.d.ts +3 -3
package/src/v4/index.js
CHANGED
|
@@ -15,61 +15,57 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.Pact = exports.PactV4 = void 0;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
const pact_core_1 = require("@pact-foundation/pact-core");
|
|
19
|
+
const unconfiguredInteraction_1 = require("./http/unconfiguredInteraction");
|
|
20
|
+
const package_json_1 = require("../../package.json");
|
|
21
|
+
const message_1 = require("./message");
|
|
22
|
+
const v3_1 = require("../v3");
|
|
23
|
+
const graphql_1 = require("./graphql");
|
|
24
|
+
const asynchronousMessage_1 = require("./message/asynchronousMessage");
|
|
25
|
+
class PactV4 {
|
|
26
|
+
opts;
|
|
27
|
+
pact;
|
|
28
|
+
constructor(opts) {
|
|
27
29
|
this.opts = opts;
|
|
28
30
|
this.setup();
|
|
31
|
+
}
|
|
32
|
+
setup() {
|
|
33
|
+
this.pact = (0, pact_core_1.makeConsumerPact)(this.opts.consumer, this.opts.provider, this.opts.spec ?? v3_1.SpecificationVersion.SPECIFICATION_VERSION_V4, this.opts.logLevel ?? 'info');
|
|
29
34
|
this.pact.addMetadata('pact-js', 'version', package_json_1.version);
|
|
30
35
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
this.pact = (0, pact_core_1.makeConsumerPact)(this.opts.consumer, this.opts.provider, (_a = this.opts.spec) !== null && _a !== void 0 ? _a : v3_1.SpecificationVersion.SPECIFICATION_VERSION_V4, (_b = this.opts.logLevel) !== null && _b !== void 0 ? _b : 'info');
|
|
34
|
-
};
|
|
35
|
-
PactV4.prototype.addInteraction = function () {
|
|
36
|
-
var _this = this;
|
|
37
|
-
return new unconfiguredInteraction_1.UnconfiguredInteraction(this.pact, this.pact.newInteraction(''), this.opts, function () {
|
|
36
|
+
addInteraction() {
|
|
37
|
+
return new unconfiguredInteraction_1.UnconfiguredInteraction(this.pact, this.pact.newInteraction(''), this.opts, () => {
|
|
38
38
|
// This function needs to be called if the PactV4 object is to be re-used (commonly expected by users)
|
|
39
39
|
// Because of the type-state model used here, it's a bit awkward as we need to thread this through
|
|
40
40
|
// to children, ultimately to be called on the "executeTest" stage.
|
|
41
|
-
|
|
41
|
+
this.setup();
|
|
42
42
|
});
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return new message_1.UnconfiguredSynchronousMessage(this.pact, this.pact.newSynchronousMessage(description), this.opts, function () {
|
|
43
|
+
}
|
|
44
|
+
addSynchronousInteraction(description) {
|
|
45
|
+
return new message_1.UnconfiguredSynchronousMessage(this.pact, this.pact.newSynchronousMessage(description), this.opts, () => {
|
|
47
46
|
// This function needs to be called if the PactV4 object is to be re-used (commonly expected by users)
|
|
48
47
|
// Because of the type-state model used here, it's a bit awkward as we need to thread this through
|
|
49
48
|
// to children, ultimately to be called on the "executeTest" stage.
|
|
50
|
-
|
|
49
|
+
this.setup();
|
|
51
50
|
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return new asynchronousMessage_1.UnconfiguredAsynchronousMessage(this.pact, this.pact.newAsynchronousMessage(''), this.opts, function () {
|
|
51
|
+
}
|
|
52
|
+
addAsynchronousInteraction() {
|
|
53
|
+
return new asynchronousMessage_1.UnconfiguredAsynchronousMessage(this.pact, this.pact.newAsynchronousMessage(''), this.opts, () => {
|
|
56
54
|
// This function needs to be called if the PactV4 object is to be re-used (commonly expected by users)
|
|
57
55
|
// Because of the type-state model used here, it's a bit awkward as we need to thread this through
|
|
58
56
|
// to children, ultimately to be called on the "executeTest" stage.
|
|
59
|
-
|
|
57
|
+
this.setup();
|
|
60
58
|
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return new graphql_1.UnconfiguredGraphQLInteraction(this.pact, this.pact.newInteraction(''), this.opts, function () {
|
|
59
|
+
}
|
|
60
|
+
addGraphQLInteraction() {
|
|
61
|
+
return new graphql_1.UnconfiguredGraphQLInteraction(this.pact, this.pact.newInteraction(''), this.opts, () => {
|
|
65
62
|
// This function needs to be called if the PactV4 object is to be re-used (commonly expected by users)
|
|
66
63
|
// Because of the type-state model used here, it's a bit awkward as we need to thread this through
|
|
67
64
|
// to children, ultimately to be called on the "executeTest" stage.
|
|
68
|
-
|
|
65
|
+
this.setup();
|
|
69
66
|
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
}());
|
|
67
|
+
}
|
|
68
|
+
}
|
|
73
69
|
exports.PactV4 = PactV4;
|
|
74
70
|
exports.Pact = PactV4;
|
|
75
71
|
__exportStar(require("./graphql"), exports);
|
package/src/v4/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v4/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version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IACJ,CAAC;IAED,0BAA0B;QACxB,OAAO,IAAI,qDAA+B,CACxC,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,EAAE,CAAC,EACpC,IAAI,CAAC,IAAI,EACT,GAAG,EAAE;YACH,sGAAsG;YACtG,kGAAkG;YAClG,mEAAmE;YACnE,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,CAAC,CACF,CAAC;IACJ,CAAC;IAED,qBAAqB;QACnB,OAAO,IAAI,wCAA8B,CACvC,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,EAC5B,IAAI,CAAC,IAAI,EACT,GAAG,EAAE;YACH,sGAAsG;YACtG,kGAAkG;YAClG,mEAAmE;YACnE,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AA1ED,wBA0EC;AAEkB,sBAAI;AACvB,4CAA0B;AAC1B,kDAAgC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Metadata } from '../../dsl/message';
|
|
2
|
-
import { AnyJson, JsonMap } from '../../common/jsonTypes';
|
|
3
|
-
import { PluginConfig, AsynchronousMessage, TransportConfig, V4AsynchronousMessageWithPlugin, V4AsynchronousMessageWithPluginContents, V4AsynchronousMessageWithTransport, V4UnconfiguredAsynchronousMessage, V4AsynchronousMessageWithContent, V4AsynchronousMessageBuilderFunc, V4AsynchronousMessageBuilder, Comment, CustomComment } from './types';
|
|
4
|
-
import { AsynchronousMessage as PactCoreAsynchronousMessage, ConsumerPact } from '@pact-foundation/pact-core';
|
|
5
|
-
import { PactV4Options } from '../http/types';
|
|
6
|
-
import { Rules } from '../../v3/types';
|
|
1
|
+
import type { Metadata } from '../../dsl/message';
|
|
2
|
+
import type { AnyJson, JsonMap } from '../../common/jsonTypes';
|
|
3
|
+
import type { PluginConfig, AsynchronousMessage, TransportConfig, V4AsynchronousMessageWithPlugin, V4AsynchronousMessageWithPluginContents, V4AsynchronousMessageWithTransport, V4UnconfiguredAsynchronousMessage, V4AsynchronousMessageWithContent, V4AsynchronousMessageBuilderFunc, V4AsynchronousMessageBuilder, Comment, CustomComment } from './types';
|
|
4
|
+
import type { AsynchronousMessage as PactCoreAsynchronousMessage, ConsumerPact } from '@pact-foundation/pact-core';
|
|
5
|
+
import type { PactV4Options } from '../http/types';
|
|
6
|
+
import type { Rules } from '../../v3/types';
|
|
7
7
|
type Message = {
|
|
8
8
|
requestIsBinary: boolean;
|
|
9
9
|
interaction: PactCoreAsynchronousMessage;
|
|
@@ -20,6 +20,7 @@ export declare class UnconfiguredAsynchronousMessage implements V4UnconfiguredAs
|
|
|
20
20
|
pending(pending?: boolean): V4UnconfiguredAsynchronousMessage;
|
|
21
21
|
comment(comment: Comment | CustomComment): V4UnconfiguredAsynchronousMessage;
|
|
22
22
|
testName(name: string): V4UnconfiguredAsynchronousMessage;
|
|
23
|
+
reference(group: string, name: string, value: string): V4UnconfiguredAsynchronousMessage;
|
|
23
24
|
usingPlugin(config: PluginConfig): V4AsynchronousMessageWithPlugin;
|
|
24
25
|
}
|
|
25
26
|
export declare class AsynchronousMessageWithPlugin implements V4AsynchronousMessageWithPlugin {
|
|
@@ -1,53 +1,22 @@
|
|
|
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 = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
-
return g.next = verb(0), g["throw"] = verb(1), g["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 (g && (g = 0, op[0] && (_ = 0)), _) 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
|
-
};
|
|
38
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
4
|
};
|
|
41
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
6
|
exports.AsynchronousMessageWithTransport = exports.AsynchronousMessageWithPluginContents = exports.AsynchronousMessageWithContent = exports.AsynchronousMessageBuilder = exports.AsynchronousMessageWithPlugin = exports.UnconfiguredAsynchronousMessage = void 0;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
7
|
+
const ramda_1 = require("ramda");
|
|
8
|
+
const configurationError_1 = __importDefault(require("../../errors/configurationError"));
|
|
9
|
+
const display_1 = require("../../v3/display");
|
|
10
|
+
const matchingRules_1 = require("../../common/matchingRules");
|
|
11
|
+
const logger_1 = __importDefault(require("../../common/logger"));
|
|
12
|
+
const defaultPactDir = './pacts';
|
|
13
|
+
class UnconfiguredAsynchronousMessage {
|
|
14
|
+
pact;
|
|
15
|
+
interaction;
|
|
16
|
+
opts;
|
|
17
|
+
cleanupFn;
|
|
18
|
+
message;
|
|
19
|
+
constructor(pact, interaction, opts, cleanupFn) {
|
|
51
20
|
this.pact = pact;
|
|
52
21
|
this.interaction = interaction;
|
|
53
22
|
this.opts = opts;
|
|
@@ -57,12 +26,12 @@ var UnconfiguredAsynchronousMessage = /** @class */ (function () {
|
|
|
57
26
|
interaction: this.interaction,
|
|
58
27
|
};
|
|
59
28
|
}
|
|
60
|
-
|
|
29
|
+
expectsToReceive(description, builder) {
|
|
61
30
|
this.interaction.expectsToReceive(description);
|
|
62
31
|
builder(new AsynchronousMessageBuilder(this.pact, this.message, this.opts));
|
|
63
32
|
return new AsynchronousMessageWithContent(this.pact, this.message, this.opts, this.cleanupFn);
|
|
64
|
-
}
|
|
65
|
-
|
|
33
|
+
}
|
|
34
|
+
given(state, parameters) {
|
|
66
35
|
if (parameters) {
|
|
67
36
|
this.message.interaction.givenWithParams(state, JSON.stringify(parameters));
|
|
68
37
|
}
|
|
@@ -70,123 +39,141 @@ var UnconfiguredAsynchronousMessage = /** @class */ (function () {
|
|
|
70
39
|
this.message.interaction.given(state);
|
|
71
40
|
}
|
|
72
41
|
return this;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (pending === void 0) { pending = true; }
|
|
42
|
+
}
|
|
43
|
+
pending(pending = true) {
|
|
76
44
|
this.message.interaction.setPending(pending);
|
|
77
45
|
return this;
|
|
78
|
-
}
|
|
79
|
-
|
|
46
|
+
}
|
|
47
|
+
comment(comment) {
|
|
80
48
|
if (typeof comment === 'string') {
|
|
81
49
|
this.message.interaction.addTextComment(comment);
|
|
82
50
|
return this;
|
|
83
51
|
}
|
|
84
52
|
this.message.interaction.setComment(comment.key, comment.value);
|
|
85
53
|
return this;
|
|
86
|
-
}
|
|
87
|
-
|
|
54
|
+
}
|
|
55
|
+
testName(name) {
|
|
88
56
|
this.message.interaction.setInteractionTestName(name);
|
|
89
57
|
return this;
|
|
90
|
-
}
|
|
91
|
-
|
|
58
|
+
}
|
|
59
|
+
reference(group, name, value) {
|
|
60
|
+
this.message.interaction.addInteractionReference(group, name, value);
|
|
61
|
+
return this;
|
|
62
|
+
}
|
|
63
|
+
usingPlugin(config) {
|
|
92
64
|
this.pact.addPlugin(config.plugin, config.version);
|
|
93
65
|
return new AsynchronousMessageWithPlugin(this.pact, this.message, this.opts, this.cleanupFn);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
}());
|
|
66
|
+
}
|
|
67
|
+
}
|
|
97
68
|
exports.UnconfiguredAsynchronousMessage = UnconfiguredAsynchronousMessage;
|
|
98
|
-
|
|
99
|
-
|
|
69
|
+
class AsynchronousMessageWithPlugin {
|
|
70
|
+
pact;
|
|
71
|
+
message;
|
|
72
|
+
opts;
|
|
73
|
+
cleanupFn;
|
|
74
|
+
constructor(pact, message, opts, cleanupFn) {
|
|
100
75
|
this.pact = pact;
|
|
101
76
|
this.message = message;
|
|
102
77
|
this.opts = opts;
|
|
103
78
|
this.cleanupFn = cleanupFn;
|
|
104
79
|
}
|
|
105
|
-
|
|
80
|
+
expectsToReceive(description) {
|
|
106
81
|
this.message.interaction.expectsToReceive(description);
|
|
107
82
|
return this;
|
|
108
|
-
}
|
|
109
|
-
|
|
83
|
+
}
|
|
84
|
+
usingPlugin(config) {
|
|
110
85
|
this.pact.addPlugin(config.plugin, config.version);
|
|
111
86
|
return this;
|
|
112
|
-
}
|
|
113
|
-
|
|
87
|
+
}
|
|
88
|
+
withPluginContents(contents, contentType) {
|
|
114
89
|
this.message.interaction.withPluginRequestInteractionContents(contentType, contents);
|
|
115
90
|
return new AsynchronousMessageWithPluginContents(this.pact, this.message, this.opts, this.cleanupFn);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
}());
|
|
91
|
+
}
|
|
92
|
+
}
|
|
119
93
|
exports.AsynchronousMessageWithPlugin = AsynchronousMessageWithPlugin;
|
|
120
|
-
|
|
121
|
-
|
|
94
|
+
class AsynchronousMessageBuilder {
|
|
95
|
+
pact;
|
|
96
|
+
message;
|
|
97
|
+
opts;
|
|
98
|
+
constructor(pact, message, opts) {
|
|
122
99
|
this.pact = pact;
|
|
123
100
|
this.message = message;
|
|
124
101
|
this.opts = opts;
|
|
125
102
|
}
|
|
126
|
-
|
|
127
|
-
var _this = this;
|
|
103
|
+
withMetadata(metadata) {
|
|
128
104
|
if ((0, ramda_1.isEmpty)(metadata)) {
|
|
129
105
|
throw new configurationError_1.default('You must provide valid metadata for the Message, or none at all');
|
|
130
106
|
}
|
|
131
|
-
(0, ramda_1.forEachObjIndexed)(
|
|
132
|
-
|
|
107
|
+
(0, ramda_1.forEachObjIndexed)((v, k) => {
|
|
108
|
+
this.message.interaction.withMetadata(`${k}`, JSON.stringify(v));
|
|
133
109
|
}, metadata);
|
|
134
110
|
return this;
|
|
135
|
-
}
|
|
136
|
-
|
|
111
|
+
}
|
|
112
|
+
withContent(contentType, body) {
|
|
137
113
|
this.message.interaction.withBinaryContents(body, contentType);
|
|
138
114
|
this.message.requestIsBinary = true;
|
|
139
115
|
return this;
|
|
140
|
-
}
|
|
141
|
-
|
|
116
|
+
}
|
|
117
|
+
withJSONContent(content) {
|
|
142
118
|
if ((0, ramda_1.isEmpty)(content)) {
|
|
143
119
|
throw new configurationError_1.default('You must provide a valid JSON document or primitive for the Message.');
|
|
144
120
|
}
|
|
145
121
|
this.message.interaction.withContents(JSON.stringify(content), 'application/json');
|
|
146
122
|
return this;
|
|
147
|
-
}
|
|
148
|
-
|
|
123
|
+
}
|
|
124
|
+
withMatchingRules(rules) {
|
|
149
125
|
(0, matchingRules_1.validateRules)(rules);
|
|
150
|
-
|
|
126
|
+
const ffiRules = (0, matchingRules_1.convertRulesToFFI)(rules);
|
|
151
127
|
this.message.interaction.withMatchingRules(JSON.stringify(ffiRules));
|
|
152
128
|
return this;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
}());
|
|
129
|
+
}
|
|
130
|
+
}
|
|
156
131
|
exports.AsynchronousMessageBuilder = AsynchronousMessageBuilder;
|
|
157
|
-
|
|
158
|
-
|
|
132
|
+
class AsynchronousMessageWithContent {
|
|
133
|
+
pact;
|
|
134
|
+
message;
|
|
135
|
+
opts;
|
|
136
|
+
cleanupFn;
|
|
137
|
+
constructor(pact, message, opts, cleanupFn) {
|
|
159
138
|
this.pact = pact;
|
|
160
139
|
this.message = message;
|
|
161
140
|
this.opts = opts;
|
|
162
141
|
this.cleanupFn = cleanupFn;
|
|
163
142
|
}
|
|
164
|
-
|
|
143
|
+
executeTest(integrationTest) {
|
|
165
144
|
return executeNonTransportTest(this.pact, this.opts, this.message, integrationTest, this.cleanupFn);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
}());
|
|
145
|
+
}
|
|
146
|
+
}
|
|
169
147
|
exports.AsynchronousMessageWithContent = AsynchronousMessageWithContent;
|
|
170
|
-
|
|
171
|
-
|
|
148
|
+
class AsynchronousMessageWithPluginContents {
|
|
149
|
+
pact;
|
|
150
|
+
message;
|
|
151
|
+
opts;
|
|
152
|
+
cleanupFn;
|
|
153
|
+
constructor(pact, message, opts, cleanupFn) {
|
|
172
154
|
this.pact = pact;
|
|
173
155
|
this.message = message;
|
|
174
156
|
this.opts = opts;
|
|
175
157
|
this.cleanupFn = cleanupFn;
|
|
176
158
|
}
|
|
177
|
-
|
|
159
|
+
executeTest(integrationTest) {
|
|
178
160
|
return executeNonTransportTest(this.pact, this.opts, this.message, integrationTest, this.cleanupFn);
|
|
179
|
-
}
|
|
180
|
-
|
|
161
|
+
}
|
|
162
|
+
startTransport(transport, address, // IP Address or hostname
|
|
181
163
|
config) {
|
|
182
|
-
|
|
164
|
+
const port = this.pact.pactffiCreateMockServerForTransport(address, transport, config ? JSON.stringify(config) : '');
|
|
183
165
|
return new AsynchronousMessageWithTransport(this.pact, this.message, this.opts, port, address, this.cleanupFn);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
}());
|
|
166
|
+
}
|
|
167
|
+
}
|
|
187
168
|
exports.AsynchronousMessageWithPluginContents = AsynchronousMessageWithPluginContents;
|
|
188
|
-
|
|
189
|
-
|
|
169
|
+
class AsynchronousMessageWithTransport {
|
|
170
|
+
pact;
|
|
171
|
+
message;
|
|
172
|
+
opts;
|
|
173
|
+
port;
|
|
174
|
+
address;
|
|
175
|
+
cleanupFn;
|
|
176
|
+
constructor(pact, message, opts, port, address, cleanupFn) {
|
|
190
177
|
this.pact = pact;
|
|
191
178
|
this.message = message;
|
|
192
179
|
this.opts = opts;
|
|
@@ -196,59 +183,47 @@ var AsynchronousMessageWithTransport = /** @class */ (function () {
|
|
|
196
183
|
}
|
|
197
184
|
// TODO: this is basically the same as the HTTP variant, except only with a different test function wrapper
|
|
198
185
|
// extract these into smaller, testable chunks and re-use them
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
throw error;
|
|
239
|
-
}
|
|
240
|
-
// Scenario: Pact validation passed, test didn't throw - return the callback value
|
|
241
|
-
cleanup(true, this.pact, this.opts, this.cleanupFn, this.port, true);
|
|
242
|
-
return [2 /*return*/, val];
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
});
|
|
246
|
-
};
|
|
247
|
-
return AsynchronousMessageWithTransport;
|
|
248
|
-
}());
|
|
186
|
+
async executeTest(integrationTest) {
|
|
187
|
+
let val;
|
|
188
|
+
let error;
|
|
189
|
+
try {
|
|
190
|
+
// TODO: need to pull this body from the plugin interaction
|
|
191
|
+
val = await integrationTest({ port: this.port, address: this.address }, {});
|
|
192
|
+
}
|
|
193
|
+
catch (e) {
|
|
194
|
+
error = e instanceof Error ? e : new Error(String(e));
|
|
195
|
+
}
|
|
196
|
+
const matchingResults = this.pact.mockServerMismatches(this.port);
|
|
197
|
+
const errors = (0, display_1.filterMissingFeatureFlag)(matchingResults);
|
|
198
|
+
const success = this.pact.mockServerMatchedSuccessfully(this.port);
|
|
199
|
+
// Scenario: Pact validation failed
|
|
200
|
+
if (!success && errors.length > 0) {
|
|
201
|
+
let errorMessage = 'Test failed for the following reasons:';
|
|
202
|
+
errorMessage += `\n\n ${(0, display_1.generateMockServerError)(matchingResults, '\t')}`;
|
|
203
|
+
cleanup(false, this.pact, this.opts, this.cleanupFn, this.port, true);
|
|
204
|
+
// If the tests throws an error, we need to rethrow the error, but print out
|
|
205
|
+
// any additional mock server errors to help the user understand what happened
|
|
206
|
+
// (The proximate cause here is often the HTTP 500 from the mock server,
|
|
207
|
+
// where the HTTP client then throws)
|
|
208
|
+
if (error) {
|
|
209
|
+
logger_1.default.error(errorMessage);
|
|
210
|
+
throw error;
|
|
211
|
+
}
|
|
212
|
+
// Test didn't throw, so we need to ensure the test fails
|
|
213
|
+
return Promise.reject(new Error(errorMessage));
|
|
214
|
+
}
|
|
215
|
+
// Scenario: test threw an error, but Pact validation was OK (error in client or test)
|
|
216
|
+
if (error) {
|
|
217
|
+
cleanup(false, this.pact, this.opts, this.cleanupFn, this.port, true);
|
|
218
|
+
throw error;
|
|
219
|
+
}
|
|
220
|
+
// Scenario: Pact validation passed, test didn't throw - return the callback value
|
|
221
|
+
cleanup(true, this.pact, this.opts, this.cleanupFn, this.port, true);
|
|
222
|
+
return val;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
249
225
|
exports.AsynchronousMessageWithTransport = AsynchronousMessageWithTransport;
|
|
250
|
-
|
|
251
|
-
if (transport === void 0) { transport = false; }
|
|
226
|
+
const cleanup = (success, pact, opts, cleanupFn, port, transport = false) => {
|
|
252
227
|
if (success) {
|
|
253
228
|
if (transport && port) {
|
|
254
229
|
pact.writePactFileForPluginServer(port, opts.dir || defaultPactDir, true);
|
|
@@ -263,40 +238,32 @@ var cleanup = function (success, pact, opts, cleanupFn, port, transport) {
|
|
|
263
238
|
pact.cleanupPlugins();
|
|
264
239
|
cleanupFn();
|
|
265
240
|
};
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
throw error;
|
|
295
|
-
}
|
|
296
|
-
// Scenario: Pact validation passed, test didn't throw - return the callback value
|
|
297
|
-
cleanup(true, pact, opts, cleanupFn);
|
|
298
|
-
return [2 /*return*/, val];
|
|
299
|
-
}
|
|
300
|
-
});
|
|
301
|
-
}); };
|
|
241
|
+
const executeNonTransportTest = async (pact, opts, message, integrationTest, cleanupFn) => {
|
|
242
|
+
let val;
|
|
243
|
+
let error;
|
|
244
|
+
try {
|
|
245
|
+
const rawInteraction = JSON.parse(message.interaction.reifyMessage());
|
|
246
|
+
const { content } = rawInteraction.contents;
|
|
247
|
+
const m = {
|
|
248
|
+
contents: {
|
|
249
|
+
content: !message.requestIsBinary
|
|
250
|
+
? content
|
|
251
|
+
: Buffer.from(content, 'base64'),
|
|
252
|
+
},
|
|
253
|
+
metadata: rawInteraction.metadata,
|
|
254
|
+
};
|
|
255
|
+
val = await integrationTest(m);
|
|
256
|
+
}
|
|
257
|
+
catch (e) {
|
|
258
|
+
error = e instanceof Error ? e : new Error(String(e));
|
|
259
|
+
}
|
|
260
|
+
// Scenario: test threw an error, but Pact validation was OK (error in client or test)
|
|
261
|
+
if (error) {
|
|
262
|
+
cleanup(false, pact, opts, cleanupFn);
|
|
263
|
+
throw error;
|
|
264
|
+
}
|
|
265
|
+
// Scenario: Pact validation passed, test didn't throw - return the callback value
|
|
266
|
+
cleanup(true, pact, opts, cleanupFn);
|
|
267
|
+
return val;
|
|
268
|
+
};
|
|
302
269
|
//# sourceMappingURL=asynchronousMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asynchronousMessage.js","sourceRoot":"","sources":["../../../../src/v4/message/asynchronousMessage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"asynchronousMessage.js","sourceRoot":"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