File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3737 "lint-staged" : " lint-staged" ,
3838 "build" : " rollup -c" ,
3939 "test" : " jest test/**/*.test.js" ,
40- "test:clean " : " jest test/clean/clean .test.js"
40+ "test:base " : " jest test/base .test.js"
4141 },
4242 "dependencies" : {
4343 "chalk" : " ^2.4.1" ,
Original file line number Diff line number Diff line change 1+ const { spawn } = require ( 'child_process' ) ;
2+
3+ describe ( 'base' , ( ) => {
4+ // 60s timeout
5+ jest . setTimeout ( 60000 ) ;
6+
7+ test ( 'no cmd' , done => {
8+ const child = spawn ( 'node' , [ 'test/no-cmd.js' ] ) ;
9+
10+ let msg = '' ;
11+
12+ child . stdout . on ( 'data' , data => {
13+ msg += data . toString ( ) ;
14+ } ) ;
15+
16+ child . stderr . on ( 'data' , data => {
17+ msg += data . toString ( ) ;
18+ } ) ;
19+
20+ child . on ( 'close' , code => {
21+ expect ( code ) . toBe ( 0 ) ;
22+ expect ( msg ) . toBe ( '' ) ;
23+ done ( ) ;
24+ } ) ;
25+ } ) ;
26+ } ) ;
Original file line number Diff line number Diff line change 1+ process . chdir ( __dirname ) ;
2+ require ( './exec' ) ( 'sclean' ) ;
You can’t perform that action at this time.
0 commit comments