File tree Expand file tree Collapse file tree 2 files changed +22
-7
lines changed
Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -19,5 +19,6 @@ require("../lib")
1919 } )
2020 . catch ( ( e ) => {
2121 console . error ( e ) ;
22+
2223 process . exit ( 1 ) ;
2324 } ) ;
Original file line number Diff line number Diff line change @@ -67,11 +67,25 @@ export default function (originOpts: any = {}) {
6767 }
6868 } ) ;
6969
70- return runCLI (
71- {
72- config : JSON . stringify ( config ) ,
73- ...opts ,
74- } ,
75- [ cwd ] ,
76- ) ;
70+ return new Promise ( ( resolve , reject ) => {
71+ runCLI (
72+ {
73+ config : JSON . stringify ( config ) ,
74+ ...opts ,
75+ } ,
76+ [ cwd ] ,
77+ )
78+ . then ( ( result ) => {
79+ const results = result . results ;
80+
81+ if ( results . success ) {
82+ resolve ( results ) ;
83+ } else {
84+ reject ( new Error ( 'Jest failed' ) ) ;
85+ }
86+ } )
87+ . catch ( ( e ) => {
88+ console . log ( e ) ;
89+ } ) ;
90+ } ) ;
7791}
You can’t perform that action at this time.
0 commit comments