@@ -27,7 +27,6 @@ test('setup', function (t) {
2727
2828var INSTALL_OPTS = [ '--loglevel' , 'silly' ]
2929var EXEC_OPTS = { cwd : installIn }
30-
3130test ( 'install bad engine' , function ( t ) {
3231 common . npm ( [ 'install' , '--engine-strict' , installFrom ] . concat ( INSTALL_OPTS ) , EXEC_OPTS , function ( err , code ) {
3332 t . ifError ( err , 'npm ran without issue' )
@@ -43,6 +42,18 @@ test('force install bad engine', function (t) {
4342 } )
4443} )
4544
45+ test ( 'warns on bad engine not strict' , function ( t ) {
46+ common . npm ( [ 'install' , '--json' , installFrom ] , EXEC_OPTS , function ( err , code , stdout , stderr ) {
47+ t . ifError ( err , 'npm ran without issue' )
48+ t . is ( code , 0 , 'result code' )
49+ var result = JSON . parse ( stdout )
50+ t . match ( result . warnings [ 1 ] , / U n s u p p o r t e d e n g i n e / , 'reason for optional failure in JSON' )
51+ t . match ( result . warnings [ 1 ] , / 1 .0 .0 - n o t - a - r e a l - v e r s i o n / , 'should print mismatch version info' )
52+ t . match ( result . warnings [ 1 ] , / N o t c o m p a t i b l e w i t h y o u r v e r s i o n o f n o d e / , 'incompatibility message' )
53+ t . done ( )
54+ } )
55+ } )
56+
4657test ( 'cleanup' , function ( t ) {
4758 cleanup ( )
4859 t . end ( )
0 commit comments