@@ -32,25 +32,25 @@ describe('Integration', () => {
3232 name : 'Project 1' ,
3333 due : '2016-02-11T09:46:56.023Z' ,
3434 tasks : [ {
35- id : 1 ,
36- name : 'Do the laundry' ,
37- 'done' : true
38- } ,
39- {
40- id : 2 ,
41- name : 'Do the dishes' ,
42- 'done' : false
43- } ,
44- {
45- id : 3 ,
46- name : 'Do the backyard' ,
47- 'done' : false
48- } ,
49- {
50- id : 4 ,
51- name : 'Do nothing' ,
52- 'done' : false
53- }
35+ id : 1 ,
36+ name : 'Do the laundry' ,
37+ 'done' : true
38+ } ,
39+ {
40+ id : 2 ,
41+ name : 'Do the dishes' ,
42+ 'done' : false
43+ } ,
44+ {
45+ id : 3 ,
46+ name : 'Do the backyard' ,
47+ 'done' : false
48+ } ,
49+ {
50+ id : 4 ,
51+ name : 'Do nothing' ,
52+ 'done' : false
53+ }
5454 ]
5555 } ]
5656
@@ -66,23 +66,23 @@ describe('Integration', () => {
6666 // add interactions, as many as needed
6767 before ( ( done ) => {
6868 provider . addInteraction ( {
69- state : 'i have a list of projects' ,
70- uponReceiving : 'a request for projects' ,
71- withRequest : {
72- method : 'get' ,
73- path : '/projects' ,
74- headers : {
75- 'Accept' : 'application/json'
76- }
77- } ,
78- willRespondWith : {
79- status : 200 ,
80- headers : {
81- 'Content-Type' : 'application/json'
69+ state : 'i have a list of projects' ,
70+ uponReceiving : 'a request for projects' ,
71+ withRequest : {
72+ method : 'get' ,
73+ path : '/projects' ,
74+ headers : {
75+ 'Accept' : 'application/json'
76+ }
8277 } ,
83- body : EXPECTED_BODY
84- }
85- } )
78+ willRespondWith : {
79+ status : 200 ,
80+ headers : {
81+ 'Content-Type' : 'application/json'
82+ } ,
83+ body : EXPECTED_BODY
84+ }
85+ } )
8686 . then ( ( ) => done ( ) )
8787 } )
8888
@@ -108,26 +108,26 @@ describe('Integration', () => {
108108 // add interactions, as many as needed
109109 before ( ( done ) => {
110110 provider . addInteraction ( {
111- state : 'i have a list of projects' ,
112- uponReceiving : 'a request for projects with a filter' ,
113- withRequest : {
114- method : 'get' ,
115- path : '/projects' ,
116- query : {
117- from : 'today'
111+ state : 'i have a list of projects' ,
112+ uponReceiving : 'a request for projects with a filter' ,
113+ withRequest : {
114+ method : 'get' ,
115+ path : '/projects' ,
116+ query : {
117+ from : 'today'
118+ } ,
119+ headers : {
120+ 'Accept' : 'application/json'
121+ }
118122 } ,
119- headers : {
120- 'Accept' : 'application/json'
123+ willRespondWith : {
124+ status : 200 ,
125+ headers : {
126+ 'Content-Type' : 'application/json'
127+ } ,
128+ body : EXPECTED_BODY
121129 }
122- } ,
123- willRespondWith : {
124- status : 200 ,
125- headers : {
126- 'Content-Type' : 'application/json'
127- } ,
128- body : EXPECTED_BODY
129- }
130- } )
130+ } )
131131 . then ( ( ) => done ( ) )
132132 } )
133133
@@ -179,8 +179,8 @@ describe('Integration', () => {
179179 name : Matchers . somethingLike ( 'Do the laundry' ) ,
180180 'done' : Matchers . somethingLike ( true )
181181 } , {
182- min : 4
183- } )
182+ min : 4
183+ } )
184184 } ]
185185 }
186186 } ) . then ( ( ) => done ( ) )
@@ -251,12 +251,12 @@ describe('Integration', () => {
251251 it ( 'allows two requests' , ( done ) => {
252252 const verificationPromise =
253253 request . get ( `${ PROVIDER_URL } /projects` )
254- . set ( {
255- 'Accept' : 'application/json'
256- } )
257- . then ( ( res ) => {
258- return res . text
259- } )
254+ . set ( {
255+ 'Accept' : 'application/json'
256+ } )
257+ . then ( ( res ) => {
258+ return res . text
259+ } )
260260 expect ( verificationPromise ) . to . eventually . eql ( JSON . stringify ( EXPECTED_BODY ) ) . notify ( done )
261261
262262 const verificationPromise404 =
@@ -298,19 +298,19 @@ describe('Integration', () => {
298298
299299 const verificationPromise =
300300 request . get ( `${ PROVIDER_URL } /projects` )
301- . set ( {
302- 'Accept' : 'application/json'
303- } )
304- . then ( ( response ) => {
305- promiseResults . push ( response )
306- return request . delete ( `${ PROVIDER_URL } /projects/2` )
307- } )
308- . then ( ( ) => { } , ( err ) => {
309- promiseResults . push ( err . response )
310- } )
311- . then ( ( ) => provider . verify ( promiseResults ) )
312-
313- expect ( verificationPromise ) . to . be . rejectedWith ( 'Error: Pact verification failed - expected interactions did not match actual.' ) . notify ( done )
301+ . set ( {
302+ 'Accept' : 'application/json'
303+ } )
304+ . then ( ( response ) => {
305+ promiseResults . push ( response )
306+ return request . delete ( `${ PROVIDER_URL } /projects/2` )
307+ } )
308+ . then ( ( ) => { } , ( err ) => {
309+ promiseResults . push ( err . response )
310+ } )
311+ . then ( ( ) => provider . verify ( promiseResults ) )
312+
313+ expect ( verificationPromise ) . to . be . rejected . notify ( done )
314314 } )
315315 } )
316316 } )
0 commit comments