@@ -21,9 +21,11 @@ describe('Settings', () => {
2121 'test' ,
2222 1000 ,
2323 ) ;
24- const settings = new Settings ( workspace ) ;
24+ const options = { shell : true } ;
25+ const settings = new Settings ( workspace , options ) ;
2526 expect ( settings . workspace ) . toEqual ( workspace ) ;
2627 expect ( settings . settings ) . toEqual ( expect . any ( Object ) ) ;
28+ expect ( settings . spawnOptions ) . toEqual ( options ) ;
2729 } ) ;
2830
2931 it ( '[jest 20] reads and parses the config' , ( ) => {
@@ -132,6 +134,39 @@ describe('Settings', () => {
132134
133135 expect ( completed ) . toHaveBeenCalled ( ) ;
134136 } ) ;
137+
138+ it ( 'passes command, args, and options to createProcess' , ( ) => {
139+ const localJestMajorVersion = 1000 ;
140+ const pathToConfig = 'test' ;
141+ const pathToJest = 'path_to_jest' ;
142+ const rootPath = 'root_path' ;
143+
144+ const workspace = new ProjectWorkspace (
145+ rootPath ,
146+ pathToJest ,
147+ pathToConfig ,
148+ localJestMajorVersion ,
149+ ) ;
150+ const createProcess = jest . fn ( ) . mockReturnValue ( {
151+ on : ( ) => { } ,
152+ stdout : new EventEmitter ( ) ,
153+ } ) ;
154+ const spawnOptions = { shell : true } ;
155+ const options : any = Object . assign ( { } , createProcess , spawnOptions ) ;
156+ const settings = new Settings ( workspace , options ) ;
157+ settings . getConfig ( ( ) => { } ) ;
158+
159+ expect ( createProcess ) . toBeCalledWith (
160+ {
161+ localJestMajorVersion,
162+ pathToConfig,
163+ pathToJest,
164+ rootPath,
165+ } ,
166+ [ '--showConfig' ] ,
167+ spawnOptions ,
168+ ) ;
169+ } ) ;
135170} ) ;
136171
137172const makeBuffer = ( content : string ) => {
0 commit comments