File tree 4 files changed +8
-17
lines changed
4 files changed +8
-17
lines changed Original file line number Diff line number Diff line change @@ -74,9 +74,7 @@ export class MessageConsumerPact {
74
74
if ( typeof state === 'string' ) {
75
75
this . message . given ( state ) ;
76
76
} else {
77
- forEachObjIndexed ( ( v , k ) => {
78
- this . message . givenWithParam ( state . name , `${ k } ` , JSON . stringify ( v ) ) ;
79
- } , state . params ) ;
77
+ this . message . givenWithParams ( state . name , JSON . stringify ( state . params ) ) ;
80
78
}
81
79
82
80
return this ;
Original file line number Diff line number Diff line change 1
- import { forEachObjIndexed , equals } from 'ramda' ;
1
+ import { equals } from 'ramda' ;
2
2
import {
3
3
makeConsumerPact ,
4
4
ConsumerPact ,
@@ -97,13 +97,10 @@ export class PactV3 {
97
97
this . interaction = this . pact . newInteraction ( description ) ;
98
98
this . states . forEach ( ( s ) => {
99
99
if ( s . parameters ) {
100
- forEachObjIndexed ( ( v , k ) => {
101
- this . interaction . givenWithParam (
102
- s . description ,
103
- `${ k } ` ,
104
- JSON . stringify ( v )
105
- ) ;
106
- } , s . parameters ) ;
100
+ this . interaction . givenWithParams (
101
+ s . description ,
102
+ JSON . stringify ( s . parameters )
103
+ ) ;
107
104
} else {
108
105
this . interaction . given ( s . description ) ;
109
106
}
Original file line number Diff line number Diff line change @@ -53,9 +53,7 @@ export class UnconfiguredInteraction implements V4UnconfiguredInteraction {
53
53
54
54
given ( state : string , parameters ?: JsonMap ) : V4UnconfiguredInteraction {
55
55
if ( parameters ) {
56
- forEachObjIndexed ( ( v , k ) => {
57
- this . interaction . givenWithParam ( state , `${ k } ` , JSON . stringify ( v ) ) ;
58
- } , parameters ) ;
56
+ this . interaction . givenWithParams ( state , JSON . stringify ( parameters ) ) ;
59
57
} else {
60
58
this . interaction . given ( state ) ;
61
59
}
Original file line number Diff line number Diff line change @@ -43,9 +43,7 @@ export class UnconfiguredSynchronousMessage
43
43
44
44
given ( state : string , parameters ?: JsonMap ) : V4UnconfiguredSynchronousMessage {
45
45
if ( parameters ) {
46
- forEachObjIndexed ( ( v , k ) => {
47
- this . interaction . givenWithParam ( state , `${ k } ` , JSON . stringify ( v ) ) ;
48
- } , parameters ) ;
46
+ this . interaction . givenWithParams ( state , JSON . stringify ( parameters ) ) ;
49
47
} else {
50
48
this . interaction . given ( state ) ;
51
49
}
You can’t perform that action at this time.
0 commit comments