Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
fix: updated deps
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Sep 14, 2018
1 parent b8ba249 commit 7996855
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 102 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
keys:
- v1-yarn-{{checksum ".circleci/config.yml"}}-{{ checksum "yarn.lock"}}
- v1-yarn-{{checksum ".circleci/config.yml"}}
- run: .circleci/greenkeeper
- run: yarn add -D nyc@11 @oclif/nyc-config@0
- run: yarn
- run: yarn add -D nyc@13 @oclif/nyc-config@1
- run: |
$NYC yarn test
$NYC report --reporter text-lcov > coverage.lcov
Expand All @@ -29,7 +29,7 @@ jobs:
- add_ssh_keys
- checkout
- restore_cache: *restore_cache
- run: yarn global add @oclif/semantic-release@1 semantic-release@12
- run: yarn global add @oclif/semantic-release@3 semantic-release@15
- run: yarn --frozen-lockfile
- run: |
export PATH=/usr/local/share/.config/yarn/global/node_modules/.bin:$PATH
Expand Down
25 changes: 0 additions & 25 deletions .circleci/greenkeeper

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"wrap-ansi": "^4.0.0"
},
"devDependencies": {
"@oclif/tslint": "^2.0.0",
"@oclif/tslint": "^3.1.0",
"@types/chai": "^4.1.4",
"@types/clean-stack": "^1.3.0",
"@types/fs-extra": "^5.0.4",
Expand All @@ -23,7 +23,7 @@
"@types/wrap-ansi": "^3.0.0",
"chai": "^4.1.2",
"chalk": "^2.4.1",
"fancy-test": "^1.4.0",
"fancy-test": "^1.4.1",
"mocha": "^5.2.0",
"ts-node": "^7.0.1",
"tslint": "^5.11.0",
Expand Down
4 changes: 2 additions & 2 deletions src/errors/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class CLIError extends Error {

protected get bang() {
let red: typeof Chalk.red = ((s: string) => s) as any
try {red = require('chalk').red} catch {}
try { red = require('chalk').red } catch {}
return red(process.platform === 'win32' ? '»' : '›')
}
}
Expand All @@ -59,7 +59,7 @@ export namespace CLIError {

protected get bang() {
let yellow: typeof Chalk.yellow = ((s: string) => s) as any
try {yellow = require('chalk').yellow} catch {}
try { yellow = require('chalk').yellow } catch {}
return yellow(process.platform === 'win32' ? '»' : '›')
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/handle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export const handle = (err: any) => {
if (config.errorLogger && err.code !== 'EEXIT') {
config.errorLogger.log(stack)
config.errorLogger.flush()
.then(() => process.exit(exitCode))
.catch(console.error)
.then(() => process.exit(exitCode))
.catch(console.error)
} else process.exit(exitCode)
} catch (e) {
console.error(err.stack)
Expand Down
94 changes: 47 additions & 47 deletions test/handle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,61 +19,61 @@ describe('handle', () => {
})

fancy
.stderr()
.finally(() => delete process.exitCode)
.it('displays an error from root handle module', ctx => {
require('../handle')(new Error('x'))
expect(ctx.stderr).to.contain('Error: x')
expect(process.exitCode).to.equal(1)
})
.stderr()
.finally(() => delete process.exitCode)
.it('displays an error from root handle module', ctx => {
require('../handle')(new Error('x'))
expect(ctx.stderr).to.contain('Error: x')
expect(process.exitCode).to.equal(1)
})

fancy
.stderr()
.finally(() => delete process.exitCode)
.it('shows an unhandled error', ctx => {
handle(new Error('x'))
expect(ctx.stderr).to.contain('Error: x')
expect(process.exitCode).to.equal(1)
})
.stderr()
.finally(() => delete process.exitCode)
.it('shows an unhandled error', ctx => {
handle(new Error('x'))
expect(ctx.stderr).to.contain('Error: x')
expect(process.exitCode).to.equal(1)
})

fancy
.stderr()
.finally(() => delete process.exitCode)
.it('handles a badly formed error object', () => {
handle({status: 400})
expect(process.exitCode).to.equal(1)
})
.stderr()
.finally(() => delete process.exitCode)
.it('handles a badly formed error object', () => {
handle({status: 400})
expect(process.exitCode).to.equal(1)
})

fancy
.stderr()
.finally(() => delete process.exitCode)
.it('shows a cli error', ctx => {
handle(new CLIError('x'))
expect(ctx.stderr).to.equal(` ${x} Error: x\n`)
expect(process.exitCode).to.equal(2)
})
.stderr()
.finally(() => delete process.exitCode)
.it('shows a cli error', ctx => {
handle(new CLIError('x'))
expect(ctx.stderr).to.equal(` ${x} Error: x\n`)
expect(process.exitCode).to.equal(2)
})

fancy
.stdout()
.stderr()
.finally(() => delete process.exitCode)
.it('hides an exit error', ctx => {
handle(new ExitError())
expect(ctx.stdout).to.equal('')
expect(ctx.stderr).to.equal('')
expect(process.exitCode).to.equal(0)
})
.stdout()
.stderr()
.finally(() => delete process.exitCode)
.it('hides an exit error', ctx => {
handle(new ExitError())
expect(ctx.stdout).to.equal('')
expect(ctx.stderr).to.equal('')
expect(process.exitCode).to.equal(0)
})

fancy
.stderr()
.do(() => config.errlog = errlog)
.finally(() => config.errlog = undefined)
.finally(() => delete process.exitCode)
.it('logs when errlog is set', async ctx => {
handle(new CLIError('uh oh!'))
expect(ctx.stderr).to.equal(` ${x} Error: uh oh!\n`)
await config.errorLogger!.flush()
expect(fs.readFileSync(errlog, 'utf8')).to.contain('Error: uh oh!')
expect(process.exitCode).to.equal(2)
})
.stderr()
.do(() => config.errlog = errlog)
.finally(() => config.errlog = undefined)
.finally(() => delete process.exitCode)
.it('logs when errlog is set', async ctx => {
handle(new CLIError('uh oh!'))
expect(ctx.stderr).to.equal(` ${x} Error: uh oh!\n`)
await config.errorLogger!.flush()
expect(fs.readFileSync(errlog, 'utf8')).to.contain('Error: uh oh!')
expect(process.exitCode).to.equal(2)
})
})
20 changes: 10 additions & 10 deletions test/warn.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ const errlog = path.join(__dirname, '../tmp/mytest/warn.log')

describe('warn', () => {
fancy
.stderr()
.do(() => config.errlog = errlog)
.finally(() => config.errlog = undefined)
.it('warns', async ctx => {
warn('foo!')
expect(ctx.stderr).to.contain('Warning: foo!')
expect(process.exitCode).to.be.undefined
await config.errorLogger!.flush()
expect(fs.readFileSync(errlog, 'utf8')).to.contain('Warning: foo!')
})
.stderr()
.do(() => config.errlog = errlog)
.finally(() => config.errlog = undefined)
.it('warns', async ctx => {
warn('foo!')
expect(ctx.stderr).to.contain('Warning: foo!')
expect(process.exitCode).to.be.undefined
await config.errorLogger!.flush()
expect(fs.readFileSync(errlog, 'utf8')).to.contain('Warning: foo!')
})
})
23 changes: 12 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
reflect-metadata "^0.1.12"
tslib "^1.8.1"

"@oclif/tslint@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@oclif/tslint/-/tslint-2.0.0.tgz#6eb3a43cc288e0e8d84bc0808c3fbcba00d00ea6"
"@oclif/tslint@^3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@oclif/tslint/-/tslint-3.1.0.tgz#4beea4ddeeb9e8964f4c9d15d25349db799311a6"
dependencies:
tslint-eslint-rules "^5.4.0"
tslint-xo "^0.9.0"

"@types/chai@^4.1.4":
Expand Down Expand Up @@ -238,17 +239,17 @@ esutils@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"

fancy-test@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/fancy-test/-/fancy-test-1.4.0.tgz#93e8b1904afbcefb496f58a05f6d2d99fc9c4acc"
fancy-test@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/fancy-test/-/fancy-test-1.4.1.tgz#c87267e01c71185ef4cd5a9cf508eb7e3adbdc94"
dependencies:
"@types/chai" "^4.1.4"
"@types/lodash" "^4.14.116"
"@types/mocha" "^5.2.5"
"@types/nock" "^9.3.0"
"@types/node" "^10.9.4"
"@types/sinon" "^5.0.2"
lodash "^4.17.10"
lodash "^4.17.11"
mock-stdin "^0.3.1"
stdout-stderr "^0.1.9"

Expand Down Expand Up @@ -349,9 +350,9 @@ jsonfile@^4.0.0:
optionalDependencies:
graceful-fs "^4.1.6"

lodash@^4.17.10:
version "4.17.10"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"
lodash@^4.17.11:
version "4.17.11"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"

make-error@^1.1.1:
version "1.3.4"
Expand Down Expand Up @@ -513,7 +514,7 @@ tslint-consistent-codestyle@^1.11.0:
tslib "^1.7.1"
tsutils "^2.27.0"

tslint-eslint-rules@^5.3.1:
tslint-eslint-rules@^5.3.1, tslint-eslint-rules@^5.4.0:
version "5.4.0"
resolved "https://registry.yarnpkg.com/tslint-eslint-rules/-/tslint-eslint-rules-5.4.0.tgz#e488cc9181bf193fe5cd7bfca213a7695f1737b5"
dependencies:
Expand Down

0 comments on commit 7996855

Please sign in to comment.