Publish v9.0.2

- Updated test cases to bring coverage back to 100%
- Updated package.json version number
- Update changelog
This commit is contained in:
Todd Bluhm 2019-05-30 00:53:20 -05:00
parent 012230dd8a
commit 09ffda4abf
No known key found for this signature in database
GPG Key ID: 9CF312607477B8AB
3 changed files with 22 additions and 3 deletions

View File

@ -1,12 +1,12 @@
# Changelog
## 9.0.2 - Unreleased
## 9.0.2
- **Fix**: CLI will now exit with non-zero error code when an error is encountered (thanks to blagh)
## 9.0.1
- **BREAKING**: Fixed major bug that required passing `--` inorder to pass flags to the command.
- **BREAKING**: Fixed major bug that required passing `--` in order to pass flags to the command.
Normally I release major breaking changes as major versions, but this was a bug and no documentation
anywhere states using `--` as intended or official behavior.
- **Change**: Fixed some documentation issues

View File

@ -1,6 +1,6 @@
{
"name": "env-cmd",
"version": "9.0.1",
"version": "9.0.2",
"description": "Executes a command using the environment variables in an env file",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@ -8,20 +8,39 @@ import * as envCmdLib from '../src/env-cmd'
describe('CLI', (): void => {
let parseArgsStub: sinon.SinonStub
let envCmdStub: sinon.SinonStub
let processExitStub: sinon.SinonStub
before((): void => {
parseArgsStub = sinon.stub(parseArgsLib, 'parseArgs')
envCmdStub = sinon.stub(envCmdLib, 'EnvCmd')
processExitStub = sinon.stub(process, 'exit')
})
after((): void => {
sinon.restore()
})
afterEach((): void => {
sinon.resetHistory()
sinon.resetBehavior()
})
it('should parse the provided args and execute the EnvCmd', async (): Promise<void> => {
parseArgsStub.returns({})
await envCmdLib.CLI(['node', './env-cmd', '-v'])
assert.equal(parseArgsStub.callCount, 1)
assert.equal(envCmdStub.callCount, 1)
assert.equal(processExitStub.callCount, 0)
})
it('should catch exception if EnvCmd throws an exception', async (): Promise<void> => {
parseArgsStub.returns({})
envCmdStub.throwsException('Error')
await envCmdLib.CLI(['node', './env-cmd', '-v'])
assert.equal(parseArgsStub.callCount, 1)
assert.equal(envCmdStub.callCount, 1)
assert.equal(processExitStub.callCount, 1)
assert.equal(processExitStub.args[0][0], 1)
})
})