Files
pnpm/test/cli.ts
zkochan 647b305291 fix(cli): return a non-zero status code on errors
When a command is passed through to npm, return the status code
that was returned by it.

Close #402
2016-10-06 21:37:04 +03:00

14 lines
371 B
TypeScript

import path = require('path')
import test = require('tape')
import spawn = require('cross-spawn')
const pnpmBin = path.join(__dirname, '../src/bin/pnpm.ts')
test('return error status code when underlying command fails', t => {
const result = spawn.sync('ts-node', [pnpmBin, 'invalid-command'])
t.equal(result.status, 1, 'error status code returned')
t.end()
})