@@ -42,6 +42,12 @@ <h3 class='mb0 no-anchor'>Pact</h3>
42
42
.create
43
43
</ a > </ li >
44
44
45
+ < li > < a
46
+ href ='#Pact.Verifier '
47
+ class ='regular pre-open '>
48
+ .Verifier
49
+ </ a > </ li >
50
+
45
51
< li > < a
46
52
href ='#Pact.Matchers '
47
53
class ='regular pre-open '>
@@ -108,6 +114,16 @@ <h3 class='mb0 no-anchor'>Pact</h3>
108
114
</ li >
109
115
110
116
117
+ < li > < a
118
+ href ='#setup '
119
+ class ="">
120
+ setup
121
+
122
+ </ a >
123
+
124
+ </ li >
125
+
126
+
111
127
< li > < a
112
128
href ='#matchers '
113
129
class =" toggle-sibling ">
@@ -147,6 +163,16 @@ <h3 class='mb0 no-anchor'>Pact</h3>
147
163
</ li >
148
164
149
165
166
+ < li > < a
167
+ href ='#providerverifier '
168
+ class ="">
169
+ ProviderVerifier
170
+
171
+ </ a >
172
+
173
+ </ li >
174
+
175
+
150
176
< li > < a
151
177
href ='#mockservice '
152
178
class =" toggle-sibling ">
@@ -272,7 +298,7 @@ <h3 class='fl m0' id='pact'>
272
298
Pact
273
299
</ h3 >
274
300
275
- < a class ='fr fill-darken0 round round pad1x quiet h5 ' href ='https://github.com/pact-foundation/pact-js/blob/82f203c5355df50798abd239590142715b69b113 /src/pact.js#L6-L6 '>
301
+ < a class ='fr fill-darken0 round round pad1x quiet h5 ' href ='https://github.com/pact-foundation/pact-js/blob/bc3120d6b7d890e9561709537ff76cfc6df84995 /src/pact.js#L6-L6 '>
276
302
< span > src/pact.js</ span >
277
303
</ a >
278
304
@@ -405,6 +431,51 @@ <h3 class='fl m0' id='pact'>
405
431
406
432
407
433
434
+
435
+
436
+
437
+
438
+ </ section >
439
+
440
+ </ div >
441
+ </ div >
442
+
443
+ < div class ='border-bottom ' id ='Pact.Verifier '>
444
+ < div class ="clearfix small pointer toggle-sibling ">
445
+ < div class ="py1 contain ">
446
+ < a class ='icon pin-right py1 dark-link caret-right '> ▸</ a >
447
+ < span class ='code strong strong truncate '> Verifier</ span >
448
+ </ div >
449
+ </ div >
450
+ < div class ="clearfix display-none toggle-target ">
451
+ < section class ='p2 mb2 clearfix bg-white minishadow '>
452
+
453
+
454
+
455
+ < p > Exposes < a href ="Verifier "> Verifier</ a > </ p >
456
+
457
+
458
+ < div class ='pre p1 fill-light mt0 '> Verifier</ div >
459
+
460
+
461
+
462
+
463
+
464
+
465
+
466
+
467
+
468
+
469
+
470
+
471
+
472
+
473
+
474
+
475
+
476
+
477
+
478
+
408
479
409
480
410
481
@@ -479,7 +550,7 @@ <h3 class='fl m0' id='pactprovider'>
479
550
PactProvider
480
551
</ h3 >
481
552
482
- < a class ='fr fill-darken0 round round pad1x quiet h5 ' href ='https://github.com/pact-foundation/pact-js/blob/82f203c5355df50798abd239590142715b69b113 /src/pact.js#L51-L115 '>
553
+ < a class ='fr fill-darken0 round round pad1x quiet h5 ' href ='https://github.com/pact-foundation/pact-js/blob/bc3120d6b7d890e9561709537ff76cfc6df84995 /src/pact.js#L66-L142 '>
483
554
< span > src/pact.js</ span >
484
555
</ a >
485
556
@@ -582,18 +653,19 @@ <h3 class='fl m0' id='pactprovider'>
582
653
< div class ="clearfix small pointer toggle-sibling ">
583
654
< div class ="py1 contain ">
584
655
< a class ='icon pin-right py1 dark-link caret-right '> ▸</ a >
585
- < span class ='code strong strong truncate '> verify(response )</ span >
656
+ < span class ='code strong strong truncate '> verify()</ span >
586
657
</ div >
587
658
</ div >
588
659
< div class ="clearfix display-none toggle-target ">
589
660
< section class ='p2 mb2 clearfix bg-white minishadow '>
590
661
591
662
592
663
593
- < p > Executes a promise chain that will eventually write the Pact file if successful.</ p >
664
+ < p > Checks with the Mock Service if the expected interactions have been exercised.
665
+ TODO: Should this finalise and write pact also?</ p >
594
666
595
667
596
- < div class ='pre p1 fill-light mt0 '> verify(response: ( < a href =" https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5 " > Response </ a > | < a href =" https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array " > Array </ a > < < a href =" https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5 " > Response </ a > >) ): < a href ="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "> Promise</ a > </ div >
668
+ < div class ='pre p1 fill-light mt0 '> verify(): < a href ="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "> Promise</ a > </ div >
597
669
598
670
599
671
@@ -604,19 +676,6 @@ <h3 class='fl m0' id='pactprovider'>
604
676
605
677
606
678
607
- < div class ='py1 quiet mt1 prose-big '> Parameters</ div >
608
- < div class ='prose '>
609
-
610
- < div class ='space-bottom0 '>
611
- < div >
612
- < span class ='code bold '> response</ span > < code class ='quiet '> ((< a href ="https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5 "> Response</ a > | < a href ="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array "> Array</ a > << a href ="https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5 "> Response</ a > >))</ code > the response object or an Array of response objects of the Request(s) issued
613
-
614
- </ div >
615
-
616
- </ div >
617
-
618
- </ div >
619
-
620
679
621
680
622
681
@@ -655,7 +714,8 @@ <h3 class='fl m0' id='pactprovider'>
655
714
656
715
657
716
658
- < p > Writes the Pact and clears any interactions left behind.</ p >
717
+ < p > Writes the Pact and clears any interactions left behind and shutdown the
718
+ mock server</ p >
659
719
660
720
661
721
< div class ='pre p1 fill-light mt0 '> finalize(): < a href ="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "> Promise</ a > </ div >
@@ -707,7 +767,9 @@ <h3 class='fl m0' id='pactprovider'>
707
767
708
768
709
769
710
- < p > Writes the Pact file but leave interactions in.</ p >
770
+ < p > Writes the pact file out to file. Should be called when all tests have been performed for a
771
+ given Consumer <-> Provider pair. It will write out the Pact to the
772
+ configured file.</ p >
711
773
712
774
713
775
< div class ='pre p1 fill-light mt0 '> writePact(): < a href ="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "> Promise</ a > </ div >
@@ -804,6 +866,61 @@ <h3 class='fl m0' id='pactprovider'>
804
866
805
867
806
868
869
+ </ section >
870
+
871
+
872
+
873
+
874
+ < section class ='p2 mb2 clearfix bg-white minishadow '>
875
+
876
+
877
+ < div class ='clearfix '>
878
+ < h3 class ='fl m0 ' id ='setup '>
879
+ setup
880
+ </ h3 >
881
+
882
+ < a class ='fr fill-darken0 round round pad1x quiet h5 ' href ='https://github.com/pact-foundation/pact-js/blob/bc3120d6b7d890e9561709537ff76cfc6df84995/src/pact.js#L72-L72 '>
883
+ < span > src/pact.js</ span >
884
+ </ a >
885
+
886
+ </ div >
887
+
888
+
889
+ < p > Start the Mock Server.</ p >
890
+
891
+
892
+ < div class ='pre p1 fill-light mt0 '> setup(): < a href ="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "> Promise</ a > </ div >
893
+
894
+
895
+
896
+
897
+
898
+
899
+
900
+
901
+
902
+
903
+
904
+
905
+
906
+
907
+
908
+ < div class ='py1 quiet mt1 prose-big '> Returns</ div >
909
+ < code > < a href ="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "> Promise</ a > </ code > :
910
+
911
+
912
+
913
+
914
+
915
+
916
+
917
+
918
+
919
+
920
+
921
+
922
+
923
+
807
924
</ section >
808
925
809
926
@@ -817,7 +934,7 @@ <h3 class='fl m0' id='matchers'>
817
934
Matchers
818
935
</ h3 >
819
936
820
- < a class ='fr fill-darken0 round round pad1x quiet h5 ' href ='https://github.com/pact-foundation/pact-js/blob/82f203c5355df50798abd239590142715b69b113 /src/dsl/matchers.js#L3-L3 '>
937
+ < a class ='fr fill-darken0 round round pad1x quiet h5 ' href ='https://github.com/pact-foundation/pact-js/blob/bc3120d6b7d890e9561709537ff76cfc6df84995 /src/dsl/matchers.js#L3-L3 '>
821
938
< span > src/dsl/matchers.js</ span >
822
939
</ a >
823
940
@@ -1084,6 +1201,54 @@ <h3 class='fl m0' id='matchers'>
1084
1201
</ div >
1085
1202
1086
1203
1204
+
1205
+
1206
+
1207
+
1208
+ </ section >
1209
+
1210
+
1211
+
1212
+
1213
+ < section class ='p2 mb2 clearfix bg-white minishadow '>
1214
+
1215
+
1216
+ < div class ='clearfix '>
1217
+ < h3 class ='fl m0 ' id ='providerverifier '>
1218
+ ProviderVerifier
1219
+ </ h3 >
1220
+
1221
+ < a class ='fr fill-darken0 round round pad1x quiet h5 ' href ='https://github.com/pact-foundation/pact-js/blob/bc3120d6b7d890e9561709537ff76cfc6df84995/src/dsl/verifier.js#L6-L6 '>
1222
+ < span > src/dsl/verifier.js</ span >
1223
+ </ a >
1224
+
1225
+ </ div >
1226
+
1227
+
1228
+ < p > Provider Verifier service</ p >
1229
+
1230
+
1231
+ < div class ='pre p1 fill-light mt0 '> ProviderVerifier</ div >
1232
+
1233
+
1234
+
1235
+
1236
+
1237
+
1238
+
1239
+
1240
+
1241
+
1242
+
1243
+
1244
+
1245
+
1246
+
1247
+
1248
+
1249
+
1250
+
1251
+
1087
1252
1088
1253
1089
1254
@@ -1101,15 +1266,16 @@ <h3 class='fl m0' id='mockservice'>
1101
1266
MockService
1102
1267
</ h3 >
1103
1268
1104
- < a class ='fr fill-darken0 round round pad1x quiet h5 ' href ='https://github.com/pact-foundation/pact-js/blob/82f203c5355df50798abd239590142715b69b113 /src/dsl/mockService.js#L7-L7 '>
1269
+ < a class ='fr fill-darken0 round round pad1x quiet h5 ' href ='https://github.com/pact-foundation/pact-js/blob/bc3120d6b7d890e9561709537ff76cfc6df84995 /src/dsl/mockService.js#L8-L8 '>
1105
1270
< span > src/dsl/mockService.js</ span >
1106
1271
</ a >
1107
1272
1108
1273
</ div >
1109
1274
1110
1275
1111
- < p > A Mock Service is the interaction mechanism through which pacts get written and verified.
1112
- This should be transparent to the end user.</ p >
1276
+ < p > Mock Service is the HTTP interface to setup the Pact Mock Service.
1277
+ See < a href ="https://github.com/bethesque/pact-mock_service "> https://github.com/bethesque/pact-mock_service</ a > and
1278
+ < a href ="https://gist.github.com/bethesque/9d81f21d6f77650811f4 "> https://gist.github.com/bethesque/9d81f21d6f77650811f4</ a > .</ p >
1113
1279
1114
1280
1115
1281
< div class ='pre p1 fill-light mt0 '> MockService</ div >
@@ -1465,7 +1631,7 @@ <h3 class='fl m0' id='interaction'>
1465
1631
Interaction
1466
1632
</ h3 >
1467
1633
1468
- < a class ='fr fill-darken0 round round pad1x quiet h5 ' href ='https://github.com/pact-foundation/pact-js/blob/82f203c5355df50798abd239590142715b69b113 /src/dsl/interaction.js#L6-L6 '>
1634
+ < a class ='fr fill-darken0 round round pad1x quiet h5 ' href ='https://github.com/pact-foundation/pact-js/blob/bc3120d6b7d890e9561709537ff76cfc6df84995 /src/dsl/interaction.js#L6-L6 '>
1469
1635
< span > src/dsl/interaction.js</ span >
1470
1636
</ a >
1471
1637
0 commit comments