File tree Expand file tree Collapse file tree 4 files changed +23
-0
lines changed Expand file tree Collapse file tree 4 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,9 @@ class NPM {
9090 if ( ! failed && ! _ . isEmpty ( err . stdout ) ) {
9191 return BbPromise . resolve ( { stdout : err . stdout } ) ;
9292 }
93+ if ( process . env . SLS_DEBUG ) {
94+ console . error ( `DEBUG: ${ err . stdout } \nSTDERR: ${ err . stderr } ` ) ;
95+ }
9396 }
9497
9598 return BbPromise . reject ( err ) ;
Original file line number Diff line number Diff line change @@ -79,6 +79,9 @@ class Yarn {
7979 if ( ! failed && ! _ . isEmpty ( err . stdout ) ) {
8080 return BbPromise . resolve ( { stdout : err . stdout } ) ;
8181 }
82+ if ( process . env . SLS_DEBUG ) {
83+ console . error ( `DEBUG: ${ err . stdout } \nSTDERR: ${ err . stderr } ` ) ;
84+ }
8285 }
8386
8487 return BbPromise . reject ( err ) ;
Original file line number Diff line number Diff line change @@ -22,9 +22,17 @@ jest.mock('../../lib/utils', () => {
2222} ) ;
2323
2424describe ( 'npm' , ( ) => {
25+ const ENV = process . env ;
26+
27+ beforeAll ( ( ) => {
28+ process . env = { ...ENV , SLS_DEBUG : '*' } ;
29+ } ) ;
2530 beforeEach ( ( ) => {
2631 fsMock . readFileSync . mockReturnValue ( false ) ;
2732 } ) ;
33+ afterAll ( ( ) => {
34+ process . env = ENV ;
35+ } ) ;
2836
2937 it ( 'should return "package-lock.json" as lockfile name' , ( ) => {
3038 expect ( npmModule . lockfileName ) . toEqual ( 'package-lock.json' ) ;
Original file line number Diff line number Diff line change @@ -16,6 +16,15 @@ jest.mock('../../lib/utils', () => {
1616} ) ;
1717
1818describe ( 'yarn' , ( ) => {
19+ const ENV = process . env ;
20+
21+ beforeAll ( ( ) => {
22+ process . env = { ...ENV , SLS_DEBUG : '*' } ;
23+ } ) ;
24+ afterAll ( ( ) => {
25+ process . env = ENV ;
26+ } ) ;
27+
1928 it ( 'should return "yarn.lock" as lockfile name' , ( ) => {
2029 expect ( yarnModule . lockfileName ) . toEqual ( 'yarn.lock' ) ;
2130 } ) ;
You can’t perform that action at this time.
0 commit comments