@@ -13,7 +13,6 @@ const checkTypes = require('check-types');
13
13
export class Message {
14
14
public readonly options : MessageOptions ;
15
15
private readonly __argMapping = {
16
- content : DEFAULT_ARG ,
17
16
pactFileWriteMode : DEFAULT_ARG ,
18
17
dir : '--pact_dir' ,
19
18
consumer : '--consumer' ,
@@ -82,7 +81,7 @@ export class Message {
82
81
public createMessage ( ) : q . Promise < unknown > {
83
82
logger . info ( `Creating message pact` ) ;
84
83
const deferred = q . defer ( ) ;
85
- const { pactFileWriteMode, ...restOptions } = this . options ;
84
+ const { pactFileWriteMode, content , ...restOptions } = this . options ;
86
85
87
86
const instance = spawn . spawnBinary (
88
87
pactStandalone . messagePath ,
@@ -92,6 +91,7 @@ export class Message {
92
91
const output : Array < string | Buffer > = [ ] ;
93
92
instance . stdout . on ( 'data' , l => output . push ( l ) ) ;
94
93
instance . stderr . on ( 'data' , l => output . push ( l ) ) ;
94
+ instance . stdin . write ( content ) ;
95
95
instance . once ( 'close' , code => {
96
96
const o = output . join ( '\n' ) ;
97
97
logger . info ( o ) ;
@@ -103,6 +103,8 @@ export class Message {
103
103
}
104
104
} ) ;
105
105
106
+ instance . stdin . end ( ) ;
107
+
106
108
return deferred . promise ;
107
109
}
108
110
}
0 commit comments