exec-sh icon indicating copy to clipboard operation
exec-sh copied to clipboard

Fix failing tests on node v8.4.0

Open tsertkov opened this issue 9 years ago • 0 comments

Tests are passing in CI and locally with node 0.10 but are failing under v8.4.0.

$ npm -v
5.4.0
$ node -v
v8.4.0
$ npm test
> [email protected] test /Users/tsertkov/Projects/exec-sh
> npm run cover-test && jshint


> [email protected] cover-test /Users/tsertkov/Projects/exec-sh
> istanbul cover --dir artifacts/coverage _mocha -- --reporter spec



  exec-sh
    module.exports
      ✓ should export a single function
    #execSh() arguments
      ✓ should pass command to spawn function
      ✓ should accept array of commands to run
      ✓ should accept true as options argument
      ✓ should merge defaults with options
      ✓ should accept optional 'callback' parameter
      1) should use 'cmd /C' command prefix on windows
      ✓ should use 'sh -c' command prefix on *nix
      ✓ should return spawn() result
      ✓ should aggregate stdoout and stderr
      ✓ should catch exceptions thrown by spawn
      ✓ should return empty stdout and stderr when spawn throws
      ✓ should run callback with error when shell exit with non-zero code


  12 passing (19ms)
  1 failing

  1) exec-sh #execSh() arguments should use 'cmd /C' command prefix on windows:
     AssertionError [ERR_ASSERTION]: 'sh' === 'cmd'
      at context.<anonymous> (/Users/tsertkov/Projects/exec-sh/test/exec-sh.js:98:14)
      at callFn (/Users/tsertkov/Projects/exec-sh/node_modules/mocha/lib/runnable.js:250:21)
      at Test.Runnable.run (/Users/tsertkov/Projects/exec-sh/node_modules/mocha/lib/runnable.js:243:7)
      at Runner.runTest (/Users/tsertkov/Projects/exec-sh/node_modules/mocha/lib/runner.js:373:10)
      at /Users/tsertkov/Projects/exec-sh/node_modules/mocha/lib/runner.js:451:12
      at next (/Users/tsertkov/Projects/exec-sh/node_modules/mocha/lib/runner.js:298:14)
      at /Users/tsertkov/Projects/exec-sh/node_modules/mocha/lib/runner.js:308:7
      at next (/Users/tsertkov/Projects/exec-sh/node_modules/mocha/lib/runner.js:246:23)
      at /Users/tsertkov/Projects/exec-sh/node_modules/mocha/lib/runner.js:270:7
      at done (/Users/tsertkov/Projects/exec-sh/node_modules/mocha/lib/runnable.js:206:5)
      at callFn (/Users/tsertkov/Projects/exec-sh/node_modules/mocha/lib/runnable.js:261:7)
      at Hook.Runnable.run (/Users/tsertkov/Projects/exec-sh/node_modules/mocha/lib/runnable.js:243:7)
      at next (/Users/tsertkov/Projects/exec-sh/node_modules/mocha/lib/runner.js:258:10)
      at Immediate.<anonymous> (/Users/tsertkov/Projects/exec-sh/node_modules/mocha/lib/runner.js:275:5)
      at runCallback (timers.js:781:20)
      at tryOnImmediate (timers.js:743:5)
      at processImmediate [as _immediateCallback] (timers.js:714:5)
$ npm -v
2.15.1
$ node -v
v.0.10.48
$ npm test

> [email protected] test /Users/tsertkov/Projects/exec-sh
> npm run cover-test && npm run jshint


> [email protected] cover-test /Users/tsertkov/Projects/exec-sh
> istanbul cover --dir artifacts/coverage _mocha -- --reporter spec



  exec-sh
    module.exports
      ✓ should export a single function
    #execSh() arguments
      ✓ should pass command to spawn function
      ✓ should accept array of commands to run
      ✓ should accept true as options argument
      ✓ should merge defaults with options
      ✓ should accept optional 'callback' parameter
      ✓ should use 'cmd /C' command prefix on windows
      ✓ should use 'sh -c' command prefix on *nix
      ✓ should return spawn() result
      ✓ should aggregate stdoout and stderr
      ✓ should catch exceptions thrown by spawn
      ✓ should return empty stdout and stderr when spawn throws
      ✓ should run callback with error when shell exit with non-zero code


  13 passing (29ms)

tsertkov avatar Aug 29 '17 13:08 tsertkov