@@ -16,6 +16,8 @@ const Interaction = require('./dsl/interaction')
16
16
const responseParser = require ( './common/responseParser' ) . parse
17
17
const serviceFactory = require ( '@pact-foundation/pact-node' )
18
18
const clc = require ( 'cli-color' )
19
+ const path = require ( 'path' )
20
+
19
21
/**
20
22
* Creates a new {@link PactProvider}.
21
23
* @memberof Pact
@@ -67,9 +69,7 @@ module.exports = (opts) => {
67
69
* Start the Mock Server.
68
70
* @returns {Promise }
69
71
*/
70
- setup : ( ) => {
71
- return server . start ( )
72
- } ,
72
+ setup : ( ) => server . start ( ) ,
73
73
74
74
/**
75
75
* Add an interaction to the {@link MockService}.
@@ -101,9 +101,7 @@ module.exports = (opts) => {
101
101
* @returns {Promise }
102
102
*/
103
103
verify : ( ) => {
104
- console . log ( 'verify()' )
105
104
return mockService . verify ( )
106
- // .then(mockService.removeInteractions)
107
105
. then ( ( ) => { mockService . removeInteractions ( ) } )
108
106
. catch ( e => {
109
107
// Properly format the error
@@ -114,16 +112,16 @@ module.exports = (opts) => {
114
112
throw new Error ( 'Pact verification failed - expected interactions did not match actual.' )
115
113
} )
116
114
} ,
115
+
117
116
/**
118
117
* Writes the Pact and clears any interactions left behind and shutdown the
119
118
* mock server
120
119
* @memberof PactProvider
121
120
* @instance
122
121
* @returns {Promise }
123
122
*/
124
- finalize : ( ) => {
125
- return mockService . writePact ( ) . then ( ( ) => server . delete ( ) )
126
- } ,
123
+ finalize : ( ) => mockService . writePact ( ) . then ( ( ) => server . delete ( ) ) ,
124
+
127
125
/**
128
126
* Writes the pact file out to file. Should be called when all tests have been performed for a
129
127
* given Consumer <-> Provider pair. It will write out the Pact to the
@@ -132,18 +130,15 @@ module.exports = (opts) => {
132
130
* @instance
133
131
* @returns {Promise }
134
132
*/
135
- writePact : ( ) => {
136
- return mockService . writePact ( )
137
- } ,
133
+ writePact : ( ) => mockService . writePact ( ) ,
134
+
138
135
/**
139
136
* Clear up any interactions in the Provider Mock Server.
140
137
* @memberof PactProvider
141
138
* @instance
142
139
* @returns {Promise }
143
140
*/
144
- removeInteractions : ( ) => {
145
- return mockService . removeInteractions ( )
146
- }
141
+ removeInteractions : ( ) => mockService . removeInteractions ( )
147
142
}
148
143
}
149
144
0 commit comments