From f12acda9c3d36bcf274437c70447da88f930762c Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Wed, 20 Jun 2018 16:34:21 -0700 Subject: [PATCH] chore: consolidate linting to monorepo --- .circleci/config.yml | 1 + .eslintignore | 2 +- .eslintrc | 5 +- packages/auth/.eslintignore | 1 - packages/auth/.eslintrc | 3 - packages/cli/src/legacy.test.js | 45 ------ packages/ps/.eslintignore | 1 - packages/ps/.eslintrc | 3 - packages/run-v5/lib/colorize.js | 4 +- packages/webhooks-v5/.eslintrc | 3 - packages/webhooks-v5/commands/webhooks/add.js | 10 +- .../commands/webhooks/deliveries/index.js | 12 +- .../commands/webhooks/deliveries/info.js | 14 +- .../commands/webhooks/events/index.js | 10 +- .../commands/webhooks/events/info.js | 12 +- .../webhooks-v5/commands/webhooks/index.js | 10 +- .../webhooks-v5/commands/webhooks/info.js | 12 +- .../webhooks-v5/commands/webhooks/remove.js | 10 +- .../webhooks-v5/commands/webhooks/update.js | 12 +- packages/webhooks-v5/lib/webhook-type.js | 4 +- packages/webhooks-v5/package.json | 8 +- .../webhooks-v5/test/commands/webhooks/add.js | 46 +++--- .../commands/webhooks/deliveries/index.js | 150 +++++++++--------- .../test/commands/webhooks/deliveries/info.js | 92 +++++------ .../test/commands/webhooks/events/index.js | 44 ++--- .../test/commands/webhooks/events/info.js | 48 +++--- .../test/commands/webhooks/index.js | 36 ++--- .../test/commands/webhooks/info.js | 28 ++-- .../test/commands/webhooks/remove.js | 8 +- .../test/commands/webhooks/update.js | 32 ++-- yarn.lock | 150 ++---------------- 31 files changed, 316 insertions(+), 500 deletions(-) delete mode 100644 packages/auth/.eslintignore delete mode 100644 packages/auth/.eslintrc delete mode 100644 packages/cli/src/legacy.test.js delete mode 100644 packages/ps/.eslintignore delete mode 100644 packages/ps/.eslintrc delete mode 100644 packages/webhooks-v5/.eslintrc diff --git a/.circleci/config.yml b/.circleci/config.yml index aa321e784d..627d433704 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,6 +30,7 @@ jobs: - run: apt-get install -y bats - run: yarn - run: yarn test + - run: eslint . - run: ./node_modules/.bin/lerna exec "curl -s https://codecov.io/bash | bash" - run: greenkeeper-lockfile-upload release: diff --git a/.eslintignore b/.eslintignore index 502167fa0b..3c3629e647 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1 @@ -/lib +node_modules diff --git a/.eslintrc b/.eslintrc index e56091ba65..a5c17549b9 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,3 +1,6 @@ { - "extends": "oclif" + "extends": "standard", + "env": { + "mocha": true + } } diff --git a/packages/auth/.eslintignore b/packages/auth/.eslintignore deleted file mode 100644 index 502167fa0b..0000000000 --- a/packages/auth/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -/lib diff --git a/packages/auth/.eslintrc b/packages/auth/.eslintrc deleted file mode 100644 index e56091ba65..0000000000 --- a/packages/auth/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "oclif" -} diff --git a/packages/cli/src/legacy.test.js b/packages/cli/src/legacy.test.js deleted file mode 100644 index e3d9274ba1..0000000000 --- a/packages/cli/src/legacy.test.js +++ /dev/null @@ -1,45 +0,0 @@ -// @flow - -import { type LegacyCommand, convertFromV5 } from './legacy' - -jest.mock('cli-engine-heroku/lib/vars', () => ({ - apiHost: 'api.foo.com', - apiUrl: 'https://api.foo.com', - gitHost: 'foo.com', - httpGitHost: 'git.foo.com', -})) - -jest.mock('cli-engine-heroku/lib/api_client', () => { - return function() { - return { auth: '1234' } - } -}) - -test('exports a context', async function() { - let ctx = {} - let l: LegacyCommand = { - topic: 'foo', - command: 'bar', - args: [], - flags: [], - run: function(context) { - ctx = context - return Promise.resolve() - }, - } - - let V5 = convertFromV5(l) - let cmd = new V5({ config: { cacheDir: '/Users/foo/.cache/heroku' } }) - cmd.argv = [] - await cmd.run() - - expect(ctx.supportsColor).toEqual(cmd.out.color.enabled) - expect(ctx.debug).toEqual(0) - expect(ctx.apiToken).toEqual('1234') - expect(ctx.apiHost).toEqual('api.foo.com') - expect(ctx.apiUrl).toEqual('https://api.foo.com') - expect(ctx.herokuDir).toEqual('/Users/foo/.cache/heroku') - expect(ctx.gitHost).toEqual('foo.com') - expect(ctx.httpGitHost).toEqual('git.foo.com') - expect(ctx.auth.password).toEqual('1234') -}) diff --git a/packages/ps/.eslintignore b/packages/ps/.eslintignore deleted file mode 100644 index 502167fa0b..0000000000 --- a/packages/ps/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -/lib diff --git a/packages/ps/.eslintrc b/packages/ps/.eslintrc deleted file mode 100644 index e56091ba65..0000000000 --- a/packages/ps/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "oclif" -} diff --git a/packages/run-v5/lib/colorize.js b/packages/run-v5/lib/colorize.js index 562e2ab38a..74f91adcae 100644 --- a/packages/run-v5/lib/colorize.js +++ b/packages/run-v5/lib/colorize.js @@ -162,7 +162,7 @@ function colorizeWeb (body) { state(stateChange[4]) ].join('') } - let apache = body.match(/^(\d+\.\d+\.\d+\.\d+ -[^-]*- \[[^\]]+\] ")(\w+)( )([^ ]+)( HTTP\/\d+\.\d+" )(\d+)( .+$)/) + let apache = body.match(/^(\d+\.\d+\.\d+\.\d+ -[^-]*- \[[^\]]+] ")(\w+)( )([^ ]+)( HTTP\/\d+\.\d+" )(\d+)( .+$)/) if (apache) { const [, ...tokens] = apache return [ @@ -238,7 +238,7 @@ function colorizeRedis (body) { } function colorizePG (body) { - let create = body.match(/^(\[DATABASE\].*)(CREATE TABLE)(.*)$/) + let create = body.match(/^(\[DATABASE].*)(CREATE TABLE)(.*)$/) if (create) { return [ other(create[1]), diff --git a/packages/webhooks-v5/.eslintrc b/packages/webhooks-v5/.eslintrc deleted file mode 100644 index e56091ba65..0000000000 --- a/packages/webhooks-v5/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "oclif" -} diff --git a/packages/webhooks-v5/commands/webhooks/add.js b/packages/webhooks-v5/commands/webhooks/add.js index 27c9f55a36..74da1fc88f 100644 --- a/packages/webhooks-v5/commands/webhooks/add.js +++ b/packages/webhooks-v5/commands/webhooks/add.js @@ -3,7 +3,7 @@ const cli = require('heroku-cli-util') const webhookType = require('../../lib/webhook-type.js') class Add extends Command { - async run() { + async run () { const {flags} = this.parse(Add) let {path, display} = webhookType(flags) @@ -15,8 +15,8 @@ class Add extends Command { level: flags.level, secret: flags.secret, url: flags.url, - authorization: flags.authorization, - }, + authorization: flags.authorization + } }) let secret if (response.headers) secret = response.headers['heroku-webhook-secret'] @@ -33,7 +33,7 @@ class Add extends Command { Add.description = 'add a webhook to an app' Add.examples = [ - '$ heroku webhooks:add -i api:dyno -l notify -u https://example.com/hooks', + '$ heroku webhooks:add -i api:dyno -l notify -u https://example.com/hooks' ] Add.flags = { @@ -43,7 +43,7 @@ Add.flags = { level: flags.string({char: 'l', description: 'notify does not retry, sync will retry until successful or timeout', required: true}), secret: flags.string({char: 's', description: 'value to sign delivery with in Heroku-Webhook-Hmac-SHA256 header'}), authorization: flags.string({char: 't', description: 'authoriation header to send with webhooks'}), - url: flags.string({char: 'u', description: 'URL for receiver', required: true}), + url: flags.string({char: 'u', description: 'URL for receiver', required: true}) } module.exports = Add diff --git a/packages/webhooks-v5/commands/webhooks/deliveries/index.js b/packages/webhooks-v5/commands/webhooks/deliveries/index.js index bb53d19af7..600bfd734c 100644 --- a/packages/webhooks-v5/commands/webhooks/deliveries/index.js +++ b/packages/webhooks-v5/commands/webhooks/deliveries/index.js @@ -3,7 +3,7 @@ const cli = require('heroku-cli-util') const webhookType = require('../../../lib/webhook-type.js') class Deliveries extends Command { - async run() { + async run () { const {flags} = this.parse(Deliveries) let {path, display} = webhookType(flags) let max = 1000 @@ -16,9 +16,9 @@ class Deliveries extends Command { let {body} = await this.heroku.get(path, { headers: { Accept: 'application/vnd.heroku+json; version=3.webhooks', - Range: `seq ..; order=desc,max=${max}`, + Range: `seq ..; order=desc,max=${max}` }, - partial: true, + partial: true }) let deliveries = body @@ -45,7 +45,7 @@ class Deliveries extends Command { {key: 'num_attempts', label: 'Attempts', get: w => String(w.num_attempts)}, {key: 'last_code', label: 'Code', get: code}, {key: 'last_error', label: 'Error', get: w => (w.last_attempt && w.last_attempt.error_class) || ''}, - {key: 'next_attempt_at', label: 'Next Attempt', get: w => w.next_attempt_at || ''}, + {key: 'next_attempt_at', label: 'Next Attempt', get: w => w.next_attempt_at || ''} ]}) } } @@ -54,13 +54,13 @@ class Deliveries extends Command { Deliveries.description = 'list webhook deliveries on an app' Deliveries.examples = [ - '$ heroku webhooks:deliveries', + '$ heroku webhooks:deliveries' ] Deliveries.flags = { app: flags.app({char: 'a'}), status: flags.string({char: 's', description: 'filter deliveries by status'}), - pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true}), + pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true}) } module.exports = Deliveries diff --git a/packages/webhooks-v5/commands/webhooks/deliveries/info.js b/packages/webhooks-v5/commands/webhooks/deliveries/info.js index 54e3c1c9b0..48b959bfcd 100644 --- a/packages/webhooks-v5/commands/webhooks/deliveries/info.js +++ b/packages/webhooks-v5/commands/webhooks/deliveries/info.js @@ -3,17 +3,17 @@ const cli = require('heroku-cli-util') const webhookType = require('../../../lib/webhook-type.js') class Info extends Command { - async run() { + async run () { const {flags, args} = this.parse(Info) let {path} = webhookType(flags) let {body} = await this.heroku.get(`${path}/webhook-deliveries/${args.id}`, { - headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'}, + headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'} }) let delivery = body let res = await this.heroku.get(`${path}/webhook-events/${delivery.event.id}`, { - headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'}, + headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'} }) let event = res.body @@ -27,7 +27,7 @@ class Info extends Command { Attempts: delivery.num_attempts, Code: delivery.last_attempt && delivery.last_attempt.code, Error: delivery.last_attempt && delivery.last_attempt.error_class, - 'Next Attempt': delivery.next_attempt_at, + 'Next Attempt': delivery.next_attempt_at } cli.styledHeader(delivery.id) @@ -41,16 +41,16 @@ class Info extends Command { Info.description = 'info for a webhook event on an app' Info.examples = [ - '$ heroku webhooks:deliveries:info 99999999-9999-9999-9999-999999999999', + '$ heroku webhooks:deliveries:info 99999999-9999-9999-9999-999999999999' ] Info.args = [ - {name: 'id'}, + {name: 'id'} ] Info.flags = { app: flags.app({char: 'a'}), - pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true}), + pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true}) } module.exports = Info diff --git a/packages/webhooks-v5/commands/webhooks/events/index.js b/packages/webhooks-v5/commands/webhooks/events/index.js index d523beb7ba..e7bc84b49f 100644 --- a/packages/webhooks-v5/commands/webhooks/events/index.js +++ b/packages/webhooks-v5/commands/webhooks/events/index.js @@ -3,13 +3,13 @@ const cli = require('heroku-cli-util') const webhookType = require('../../../lib/webhook-type.js') class Events extends Command { - async run() { + async run () { const {flags} = this.parse(Events) cli.warn('heroku webhooks:event is deprecated, please use heroku webhooks:deliveries') let {path, display} = webhookType(flags) let {body} = await this.heroku.get(`${path}/webhook-events`, { - headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'}, + headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'} }) let events = body @@ -22,7 +22,7 @@ class Events extends Command { {key: 'id', label: 'Event ID'}, {key: 'resource', label: 'Resource', get: w => w.payload.resource}, {key: 'action', label: 'Action', get: w => w.payload.action}, - {key: 'published_at', label: 'Published At', get: w => w.payload.published_at}, + {key: 'published_at', label: 'Published At', get: w => w.payload.published_at} ]}) } } @@ -31,12 +31,12 @@ class Events extends Command { Events.description = 'list webhook events on an app' Events.examples = [ - '$ heroku webhooks:events', + '$ heroku webhooks:events' ] Events.flags = { app: flags.app({char: 'a'}), - pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true}), + pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true}) } module.exports = Events diff --git a/packages/webhooks-v5/commands/webhooks/events/info.js b/packages/webhooks-v5/commands/webhooks/events/info.js index 759d68384a..641ef0dfcf 100644 --- a/packages/webhooks-v5/commands/webhooks/events/info.js +++ b/packages/webhooks-v5/commands/webhooks/events/info.js @@ -3,18 +3,18 @@ const cli = require('heroku-cli-util') const webhookType = require('../../../lib/webhook-type.js') class Info extends Command { - async run() { + async run () { const {flags, args} = this.parse(Info) cli.warn('heroku webhooks:event:info is deprecated, please use heroku webhooks:deliveries:info') let {path} = webhookType(flags) let {body} = await this.heroku.get(`${path}/webhook-events/${args.id}`, { - headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'}, + headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'} }) let webhookEvent = body let obj = { - payload: JSON.stringify(webhookEvent.payload, null, 2), + payload: JSON.stringify(webhookEvent.payload, null, 2) } cli.styledHeader(webhookEvent.id) @@ -25,16 +25,16 @@ class Info extends Command { Info.description = 'info for a webhook event on an app' Info.examples = [ - '$ heroku webhooks:events:info 99999999-9999-9999-9999-999999999999', + '$ heroku webhooks:events:info 99999999-9999-9999-9999-999999999999' ] Info.flags = { app: flags.app({char: 'a'}), - pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true}), + pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true}) } Info.args = [ - {name: 'id'}, + {name: 'id'} ] module.exports = Info diff --git a/packages/webhooks-v5/commands/webhooks/index.js b/packages/webhooks-v5/commands/webhooks/index.js index c79583c479..973532f009 100644 --- a/packages/webhooks-v5/commands/webhooks/index.js +++ b/packages/webhooks-v5/commands/webhooks/index.js @@ -3,12 +3,12 @@ const cli = require('heroku-cli-util') const webhookType = require('../../lib/webhook-type.js') class Webhooks extends Command { - async run() { + async run () { const {flags} = this.parse(Webhooks) let {path, display} = webhookType(flags) let {body} = await this.heroku.get(`${path}/webhooks`, { - headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'}, + headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'} }) let webhooks = body @@ -23,7 +23,7 @@ class Webhooks extends Command { {key: 'id', label: 'Webhook ID'}, {key: 'url', label: 'URL'}, {key: 'include', label: 'Include'}, - {key: 'level', label: 'Level'}, + {key: 'level', label: 'Level'} ]}) } } @@ -31,12 +31,12 @@ class Webhooks extends Command { Webhooks.description = 'list webhooks on an app' Webhooks.examples = [ - '$ heroku webhooks', + '$ heroku webhooks' ] Webhooks.flags = { app: flags.app({char: 'a'}), - pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true}), + pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true}) } module.exports = Webhooks diff --git a/packages/webhooks-v5/commands/webhooks/info.js b/packages/webhooks-v5/commands/webhooks/info.js index 8a38e59d2e..4c4857e131 100644 --- a/packages/webhooks-v5/commands/webhooks/info.js +++ b/packages/webhooks-v5/commands/webhooks/info.js @@ -3,12 +3,12 @@ const cli = require('heroku-cli-util') const webhookType = require('../../lib/webhook-type.js') class Info extends Command { - async run() { + async run () { const {flags, args} = this.parse(Info) let {path} = webhookType(flags) let {body} = await this.heroku.get(`${path}/webhooks/${args.id}`, { - headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'}, + headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'} }) let webhook = body @@ -16,7 +16,7 @@ class Info extends Command { 'Webhook ID': webhook.id, URL: webhook.url, Include: webhook.include.join(','), - Level: webhook.level, + Level: webhook.level } cli.styledHeader(webhook.id) @@ -27,16 +27,16 @@ class Info extends Command { Info.description = 'info for a webhook on an app' Info.examples = [ - '$ heroku webhooks:info 99999999-9999-9999-9999-999999999999', + '$ heroku webhooks:info 99999999-9999-9999-9999-999999999999' ] Info.flags = { app: flags.app({char: 'a'}), - pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true}), + pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true}) } Info.args = [ - {name: 'id'}, + {name: 'id'} ] module.exports = Info diff --git a/packages/webhooks-v5/commands/webhooks/remove.js b/packages/webhooks-v5/commands/webhooks/remove.js index cfa4436853..b280025e49 100644 --- a/packages/webhooks-v5/commands/webhooks/remove.js +++ b/packages/webhooks-v5/commands/webhooks/remove.js @@ -3,12 +3,12 @@ const cli = require('heroku-cli-util') const webhookType = require('../../lib/webhook-type.js') class Remove extends Command { - async run() { + async run () { const {flags, args} = this.parse(Remove) let {path, display} = webhookType(flags) await cli.action(`Removing webhook ${args.id} from ${display}`, {}, this.heroku.delete(`${path}/webhooks/${args.id}`, { - headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'}, + headers: {Accept: 'application/vnd.heroku+json; version=3.webhooks'} } )) } @@ -17,16 +17,16 @@ class Remove extends Command { Remove.description = 'removes a webhook from an app' Remove.examples = [ - '$ heroku webhooks:remove 99999999-9999-9999-9999-999999999999', + '$ heroku webhooks:remove 99999999-9999-9999-9999-999999999999' ] Remove.flags = { app: flags.app({char: 'a'}), - pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true}), + pipeline: flags.string({char: 'p', description: 'pipeline on which to list', hidden: true}) } Remove.args = [ - {name: 'id', description: 'id of webhook to remove'}, + {name: 'id', description: 'id of webhook to remove'} ] module.exports = Remove diff --git a/packages/webhooks-v5/commands/webhooks/update.js b/packages/webhooks-v5/commands/webhooks/update.js index 26de9e1174..99c5f17174 100644 --- a/packages/webhooks-v5/commands/webhooks/update.js +++ b/packages/webhooks-v5/commands/webhooks/update.js @@ -3,7 +3,7 @@ const cli = require('heroku-cli-util') const webhookType = require('../../lib/webhook-type.js') class Update extends Command { - async run() { + async run () { const {flags, args} = this.parse(Update) let {path, display} = webhookType(flags) await cli.action(`Updating webhook ${args.id} for ${display}`, {}, @@ -13,8 +13,8 @@ class Update extends Command { include: flags.include && flags.include.split(',').map(s => s.trim()), level: flags.level, secret: flags.secret, - url: flags.url, - }, + url: flags.url + } }) ) } @@ -23,7 +23,7 @@ class Update extends Command { Update.description = 'updates a webhook in an app' Update.examples = [ - '$ heroku webhooks:update 99999999-9999-9999-9999-999999999999 -i dyno -l notify -s 09928c40bf1b191b645174a19f7053d16a180da37332e719ef0998f4c0a2 -u https://example.com/hooks', + '$ heroku webhooks:update 99999999-9999-9999-9999-999999999999 -i dyno -l notify -s 09928c40bf1b191b645174a19f7053d16a180da37332e719ef0998f4c0a2 -u https://example.com/hooks' ] Update.flags = { @@ -33,11 +33,11 @@ Update.flags = { level: flags.string({char: 'l', description: 'notify does not retry, sync will retry until successful or timeout', required: true}), secret: flags.string({char: 's', description: 'value to sign delivery with in Heroku-Webhook-Hmac-SHA256 header'}), authorization: flags.string({char: 't', description: 'authoriation header to send with webhooks'}), - url: flags.string({char: 'u', description: 'URL for receiver', required: true}), + url: flags.string({char: 'u', description: 'URL for receiver', required: true}) } Update.args = [ - {name: 'id'}, + {name: 'id'} ] module.exports = Update diff --git a/packages/webhooks-v5/lib/webhook-type.js b/packages/webhooks-v5/lib/webhook-type.js index 8a32b2b999..b0b8b12ba6 100644 --- a/packages/webhooks-v5/lib/webhook-type.js +++ b/packages/webhooks-v5/lib/webhook-type.js @@ -4,13 +4,13 @@ module.exports = function (context) { if (context.pipeline) { return { path: `/pipelines/${context.pipeline}`, - display: context.pipeline, + display: context.pipeline } } if (context.app) { return { path: `/apps/${context.app}`, - display: cli.color.app(context.app), + display: cli.color.app(context.app) } } throw new Error('No app specified') diff --git a/packages/webhooks-v5/package.json b/packages/webhooks-v5/package.json index 9ab2aab23e..6ad8bf17c5 100644 --- a/packages/webhooks-v5/package.json +++ b/packages/webhooks-v5/package.json @@ -12,13 +12,11 @@ "@oclif/dev-cli": "^1.15.2", "@oclif/plugin-legacy": "^1.0.15", "chai": "^4.1.2", - "eslint": "^4.19.1", - "eslint-config-oclif": "^1.5.1", - "eslint-config-xo": "^0.22.2", "mocha": "^5.2.0", "mocha-junit-reporter": "1.17.0", "nock": "9.3.3", - "nyc": "12.0.2" + "nyc": "12.0.2", + "standard": "^11.0.1" }, "engines": { "node": ">=8.0.0" @@ -47,7 +45,7 @@ "scripts": { "postpublish": "rm oclif.manifest.json", "prepublishOnly": "oclif-dev manifest", - "test": "TZ=utc nyc mocha && eslint .", + "test": "TZ=utc nyc mocha && standard", "version": "oclif-dev readme && git add README.md" } } diff --git a/packages/webhooks-v5/test/commands/webhooks/add.js b/packages/webhooks-v5/test/commands/webhooks/add.js index 1ab9d6f6fe..b789c2b593 100644 --- a/packages/webhooks-v5/test/commands/webhooks/add.js +++ b/packages/webhooks-v5/test/commands/webhooks/add.js @@ -13,20 +13,20 @@ describe('heroku webhooks:add', function () { it('# adds an webhook', function () { let mock = nock('https://api.heroku.com') - .post('/apps/example/webhooks', { - include: ['foo', 'bar'], - level: 'notify', - secret: '1234', - url: 'http://foobar.com', - }) - .reply(200, {}) + .post('/apps/example/webhooks', { + include: ['foo', 'bar'], + level: 'notify', + secret: '1234', + url: 'http://foobar.com' + }) + .reply(200, {}) return certs.run([ '--app', 'example', '--include', 'foo,bar', '--secret', '1234', '--level', 'notify', - '--url', 'http://foobar.com', + '--url', 'http://foobar.com' ]).then(function () { mock.done() expect(cli.stderr).to.equal('Adding webhook to example... done\n') @@ -36,18 +36,18 @@ describe('heroku webhooks:add', function () { it('# adds an webhook with secret', function () { let mock = nock('https://api.heroku.com') - .post('/apps/example/webhooks', { - include: ['foo', 'bar'], - level: 'notify', - url: 'http://foobar.com', - }) - .reply(200, {}, {'Heroku-Webhook-Secret': '1234'}) + .post('/apps/example/webhooks', { + include: ['foo', 'bar'], + level: 'notify', + url: 'http://foobar.com' + }) + .reply(200, {}, {'Heroku-Webhook-Secret': '1234'}) return certs.run([ '--app', 'example', '--include', 'foo,bar', '--level', 'notify', - '--url', 'http://foobar.com', + '--url', 'http://foobar.com' ]).then(function () { mock.done() expect(cli.stderr).to.equal('Adding webhook to example... done\n') @@ -57,20 +57,20 @@ describe('heroku webhooks:add', function () { it('# adds a pipeline webhook', function () { let mock = nock('https://api.heroku.com') - .post('/pipelines/example/webhooks', { - include: ['foo', 'bar'], - level: 'notify', - secret: '1234', - url: 'http://foobar.com', - }) - .reply(200, {}) + .post('/pipelines/example/webhooks', { + include: ['foo', 'bar'], + level: 'notify', + secret: '1234', + url: 'http://foobar.com' + }) + .reply(200, {}) return certs.run([ '--pipeline', 'example', '--include', 'foo,bar', '--secret', '1234', '--level', 'notify', - '--url', 'http://foobar.com', + '--url', 'http://foobar.com' ]).then(function () { mock.done() expect(cli.stderr).to.equal('Adding webhook to example... done\n') diff --git a/packages/webhooks-v5/test/commands/webhooks/deliveries/index.js b/packages/webhooks-v5/test/commands/webhooks/deliveries/index.js index 6cd0928d57..e504ed3733 100644 --- a/packages/webhooks-v5/test/commands/webhooks/deliveries/index.js +++ b/packages/webhooks-v5/test/commands/webhooks/deliveries/index.js @@ -14,41 +14,41 @@ describe('heroku webhooks:deliveries', function () { it('# lists deliveries', function () { let mock = nock('https://api.heroku.com', { - reqheaders: {range: 'seq ..; order=desc,max=1000'}, + reqheaders: {range: 'seq ..; order=desc,max=1000'} }) - .get('/apps/example/webhook-deliveries') - .reply(206, [{ - id: '66666666-6666-6666-6666-666666666666', - event: { - id: '55555555-5555-5555-5555-555555555555', - include: 'api:build', - }, - webhook: { - id: '44444444-4444-4444-4444-444444444444', - level: 'notify', - }, - status: 'pending', - num_attempts: 4, - created_at: '2017-08-17T20:22:38Z', - }, { - id: '99999999-9999-9999-9999-999999999999', - event: { - id: '88888888-8888-8888-8888-888888888888', - include: 'api:build', - }, - webhook: { - id: '77777777-7777-7777-7777-777777777777', - level: 'notify', - }, - last_attempt: { - code: 401, - error_class: 'Foobar', - }, - status: 'retrying', - num_attempts: 4, - created_at: '2017-08-17T20:22:37Z', - next_attempt_at: '2017-08-17T20:22:39Z', - }], {'next-range': 'id 99999999-9999-9999-9999-999999999999'}) + .get('/apps/example/webhook-deliveries') + .reply(206, [{ + id: '66666666-6666-6666-6666-666666666666', + event: { + id: '55555555-5555-5555-5555-555555555555', + include: 'api:build' + }, + webhook: { + id: '44444444-4444-4444-4444-444444444444', + level: 'notify' + }, + status: 'pending', + num_attempts: 4, + created_at: '2017-08-17T20:22:38Z' + }, { + id: '99999999-9999-9999-9999-999999999999', + event: { + id: '88888888-8888-8888-8888-888888888888', + include: 'api:build' + }, + webhook: { + id: '77777777-7777-7777-7777-777777777777', + level: 'notify' + }, + last_attempt: { + code: 401, + error_class: 'Foobar' + }, + status: 'retrying', + num_attempts: 4, + created_at: '2017-08-17T20:22:37Z', + next_attempt_at: '2017-08-17T20:22:39Z' + }], {'next-range': 'id 99999999-9999-9999-9999-999999999999'}) return certs.run(['--app', 'example']).then(function () { mock.done() @@ -64,23 +64,23 @@ describe('heroku webhooks:deliveries', function () { it('# lists deliveries by state', function () { let mock = nock('https://api.heroku.com', { - reqheaders: {range: 'seq ..; order=desc,max=1000'}, + reqheaders: {range: 'seq ..; order=desc,max=1000'} }) - .get('/apps/example/webhook-deliveries?eq[status]=pending') - .reply(206, [{ - id: '66666666-6666-6666-6666-666666666666', - event: { - id: '55555555-5555-5555-5555-555555555555', - include: 'api:build', - }, - webhook: { - id: '44444444-4444-4444-4444-444444444444', - level: 'notify', - }, - status: 'pending', - num_attempts: 4, - created_at: '2017-08-17T20:22:38Z', - }]) + .get('/apps/example/webhook-deliveries?eq[status]=pending') + .reply(206, [{ + id: '66666666-6666-6666-6666-666666666666', + event: { + id: '55555555-5555-5555-5555-555555555555', + include: 'api:build' + }, + webhook: { + id: '44444444-4444-4444-4444-444444444444', + level: 'notify' + }, + status: 'pending', + num_attempts: 4, + created_at: '2017-08-17T20:22:38Z' + }]) return certs.run(['--app', 'example', '--status', 'pending']).then(function () { mock.done() @@ -98,22 +98,22 @@ describe('heroku webhooks:deliveries', function () { id: '66666666-6666-6666-6666-666666666666', event: { id: '55555555-5555-5555-5555-555555555555', - include: 'api:build', + include: 'api:build' }, webhook: { id: '44444444-4444-4444-4444-444444444444', - level: 'notify', + level: 'notify' }, status: 'pending', num_attempts: 4, - created_at: '2017-08-17T20:22:38Z', + created_at: '2017-08-17T20:22:38Z' } let mock = nock('https://api.heroku.com', { - reqheaders: {range: 'seq ..; order=desc,max=1000'}, + reqheaders: {range: 'seq ..; order=desc,max=1000'} }) - .get('/apps/example/webhook-deliveries') - .reply(206, new Array(1000).fill().map(() => delivery)) + .get('/apps/example/webhook-deliveries') + .reply(206, new Array(1000).fill().map(() => delivery)) return certs.run(['--app', 'example']).then(function () { mock.done() @@ -123,8 +123,8 @@ describe('heroku webhooks:deliveries', function () { it('# lists empty deliveries', function () { let mock = nock('https://api.heroku.com') - .get('/apps/example/webhook-deliveries') - .reply(200, []) + .get('/apps/example/webhook-deliveries') + .reply(200, []) return certs.run(['--app', 'example']).then(function () { mock.done() @@ -135,21 +135,21 @@ describe('heroku webhooks:deliveries', function () { it('# lists deliveries (piplines)', function () { let mock = nock('https://api.heroku.com') - .get('/pipelines/example/webhook-deliveries') - .reply(200, [{ - id: '66666666-6666-6666-6666-666666666666', - event: { - id: '55555555-5555-5555-5555-555555555555', - include: 'api:build', - }, - webhook: { - id: '44444444-4444-4444-4444-444444444444', - level: 'notify', - }, - status: 'pending', - num_attempts: 4, - created_at: '2017-08-17T20:22:38Z', - }]) + .get('/pipelines/example/webhook-deliveries') + .reply(200, [{ + id: '66666666-6666-6666-6666-666666666666', + event: { + id: '55555555-5555-5555-5555-555555555555', + include: 'api:build' + }, + webhook: { + id: '44444444-4444-4444-4444-444444444444', + level: 'notify' + }, + status: 'pending', + num_attempts: 4, + created_at: '2017-08-17T20:22:38Z' + }]) return certs.run(['--pipeline', 'example']).then(function () { mock.done() @@ -164,8 +164,8 @@ describe('heroku webhooks:deliveries', function () { it('# lists empty deliveries (pipelines)', function () { let mock = nock('https://api.heroku.com') - .get('/pipelines/example/webhook-deliveries') - .reply(200, []) + .get('/pipelines/example/webhook-deliveries') + .reply(200, []) return certs.run(['--pipeline', 'example']).then(function () { mock.done() diff --git a/packages/webhooks-v5/test/commands/webhooks/deliveries/info.js b/packages/webhooks-v5/test/commands/webhooks/deliveries/info.js index f576521e70..dc7c63fb7c 100644 --- a/packages/webhooks-v5/test/commands/webhooks/deliveries/info.js +++ b/packages/webhooks-v5/test/commands/webhooks/deliveries/info.js @@ -14,31 +14,31 @@ describe('heroku webhooks:deliveries:info', function () { it('# shows a delivery', function () { let mockDelivery = nock('https://api.heroku.com') - .get('/apps/example/webhook-deliveries/99999999-9999-9999-9999-999999999999') - .reply(200, { - id: '99999999-9999-9999-9999-999999999999', - event: { - id: '88888888-8888-8888-8888-888888888888', - }, - webhook: { - id: '77777777-7777-7777-7777-777777777777', - }, - status: 'pending', - }) + .get('/apps/example/webhook-deliveries/99999999-9999-9999-9999-999999999999') + .reply(200, { + id: '99999999-9999-9999-9999-999999999999', + event: { + id: '88888888-8888-8888-8888-888888888888' + }, + webhook: { + id: '77777777-7777-7777-7777-777777777777' + }, + status: 'pending' + }) let mockEvent = nock('https://api.heroku.com') - .get('/apps/example/webhook-events/88888888-8888-8888-8888-888888888888') - .reply(200, { - id: '88888888-8888-8888-8888-888888888888', - payload: { - published_at: '2016-08-31T21:55:06Z', - resource: 'api:release', - action: 'create', - data: { - foo: 'bar', - }, - }, - }) + .get('/apps/example/webhook-events/88888888-8888-8888-8888-888888888888') + .reply(200, { + id: '88888888-8888-8888-8888-888888888888', + payload: { + published_at: '2016-08-31T21:55:06Z', + resource: 'api:release', + action: 'create', + data: { + foo: 'bar' + } + } + }) return certs.run(['99999999-9999-9999-9999-999999999999', '--app', 'example']).then(function () { mockDelivery.done() @@ -64,31 +64,31 @@ Webhook: 77777777-7777-7777-7777-777777777777 it('# shows a delivery (piplines)', function () { let mockDelivery = nock('https://api.heroku.com') - .get('/pipelines/example/webhook-deliveries/99999999-9999-9999-9999-999999999999') - .reply(200, { - id: '99999999-9999-9999-9999-999999999999', - event: { - id: '88888888-8888-8888-8888-888888888888', - }, - webhook: { - id: '77777777-7777-7777-7777-777777777777', - }, - status: 'pending', - }) + .get('/pipelines/example/webhook-deliveries/99999999-9999-9999-9999-999999999999') + .reply(200, { + id: '99999999-9999-9999-9999-999999999999', + event: { + id: '88888888-8888-8888-8888-888888888888' + }, + webhook: { + id: '77777777-7777-7777-7777-777777777777' + }, + status: 'pending' + }) let mockEvent = nock('https://api.heroku.com') - .get('/pipelines/example/webhook-events/88888888-8888-8888-8888-888888888888') - .reply(200, { - id: '88888888-8888-8888-8888-888888888888', - payload: { - published_at: '2016-08-31T21:55:06Z', - resource: 'api:release', - action: 'create', - data: { - foo: 'bar', - }, - }, - }) + .get('/pipelines/example/webhook-events/88888888-8888-8888-8888-888888888888') + .reply(200, { + id: '88888888-8888-8888-8888-888888888888', + payload: { + published_at: '2016-08-31T21:55:06Z', + resource: 'api:release', + action: 'create', + data: { + foo: 'bar' + } + } + }) return certs.run(['99999999-9999-9999-9999-999999999999', '--pipeline', 'example']).then(function () { mockDelivery.done() diff --git a/packages/webhooks-v5/test/commands/webhooks/events/index.js b/packages/webhooks-v5/test/commands/webhooks/events/index.js index b264090a25..a61bfffb10 100644 --- a/packages/webhooks-v5/test/commands/webhooks/events/index.js +++ b/packages/webhooks-v5/test/commands/webhooks/events/index.js @@ -14,16 +14,16 @@ describe('heroku webhooks:events', function () { it('# lists events', function () { let mock = nock('https://api.heroku.com') - .get('/apps/example/webhook-events') - .reply(200, [{ - id: '99999999-9999-9999-9999-999999999999', - payload: { - published_at: '2016-08-31T21:55:06Z', - resource: 'api:release', - action: 'create', - }, + .get('/apps/example/webhook-events') + .reply(200, [{ + id: '99999999-9999-9999-9999-999999999999', + payload: { + published_at: '2016-08-31T21:55:06Z', + resource: 'api:release', + action: 'create' + } - }]) + }]) return certs.run(['--app', 'example']).then(function () { mock.done() @@ -38,16 +38,16 @@ describe('heroku webhooks:events', function () { it('# lists events (pipelines)', function () { let mock = nock('https://api.heroku.com') - .get('/pipelines/example/webhook-events') - .reply(200, [{ - id: '99999999-9999-9999-9999-999999999999', - payload: { - published_at: '2016-08-31T21:55:06Z', - resource: 'api:release', - action: 'create', - }, + .get('/pipelines/example/webhook-events') + .reply(200, [{ + id: '99999999-9999-9999-9999-999999999999', + payload: { + published_at: '2016-08-31T21:55:06Z', + resource: 'api:release', + action: 'create' + } - }]) + }]) return certs.run(['--pipeline', 'example']).then(function () { mock.done() @@ -62,8 +62,8 @@ describe('heroku webhooks:events', function () { it('# lists empty events', function () { let mock = nock('https://api.heroku.com') - .get('/apps/example/webhook-events') - .reply(200, []) + .get('/apps/example/webhook-events') + .reply(200, []) return certs.run(['--app', 'example']).then(function () { mock.done() @@ -74,8 +74,8 @@ describe('heroku webhooks:events', function () { it('# lists empty events (pipelines)', function () { let mock = nock('https://api.heroku.com') - .get('/pipelines/example/webhook-events') - .reply(200, []) + .get('/pipelines/example/webhook-events') + .reply(200, []) return certs.run(['--pipeline', 'example']).then(function () { mock.done() diff --git a/packages/webhooks-v5/test/commands/webhooks/events/info.js b/packages/webhooks-v5/test/commands/webhooks/events/info.js index c4f4ceb724..3d31078ca2 100644 --- a/packages/webhooks-v5/test/commands/webhooks/events/info.js +++ b/packages/webhooks-v5/test/commands/webhooks/events/info.js @@ -14,18 +14,18 @@ describe('heroku webhooks:events:info', function () { it('# shows an event', function () { let mock = nock('https://api.heroku.com') - .get('/apps/example/webhook-events/99999999-9999-9999-9999-999999999999') - .reply(200, { - id: '99999999-9999-9999-9999-999999999999', - payload: { - published_at: '2016-08-31T21:55:06Z', - resource: 'api:release', - action: 'create', - data: { - foo: 'bar', - }, - }, - }) + .get('/apps/example/webhook-events/99999999-9999-9999-9999-999999999999') + .reply(200, { + id: '99999999-9999-9999-9999-999999999999', + payload: { + published_at: '2016-08-31T21:55:06Z', + resource: 'api:release', + action: 'create', + data: { + foo: 'bar' + } + } + }) return certs.run(['--app', 'example', '99999999-9999-9999-9999-999999999999']).then(function () { mock.done() @@ -46,18 +46,18 @@ payload: { it('# shows an event (pipelines)', function () { let mock = nock('https://api.heroku.com') - .get('/pipelines/example/webhook-events/99999999-9999-9999-9999-999999999999') - .reply(200, { - id: '99999999-9999-9999-9999-999999999999', - payload: { - published_at: '2016-08-31T21:55:06Z', - resource: 'api:release', - action: 'create', - data: { - foo: 'bar', - }, - }, - }) + .get('/pipelines/example/webhook-events/99999999-9999-9999-9999-999999999999') + .reply(200, { + id: '99999999-9999-9999-9999-999999999999', + payload: { + published_at: '2016-08-31T21:55:06Z', + resource: 'api:release', + action: 'create', + data: { + foo: 'bar' + } + } + }) return certs.run(['--pipeline', 'example', '99999999-9999-9999-9999-999999999999']).then(function () { mock.done() diff --git a/packages/webhooks-v5/test/commands/webhooks/index.js b/packages/webhooks-v5/test/commands/webhooks/index.js index 43d1871088..952451ab9d 100644 --- a/packages/webhooks-v5/test/commands/webhooks/index.js +++ b/packages/webhooks-v5/test/commands/webhooks/index.js @@ -13,13 +13,13 @@ describe('heroku webhooks:add', function () { it('# lists webhooks', function () { let mock = nock('https://api.heroku.com') - .get('/apps/example/webhooks') - .reply(200, [{ - id: '99999999-9999-9999-9999-999999999999', - include: ['foo', 'bar'], - level: 'notify', - url: 'http://foobar.com', - }]) + .get('/apps/example/webhooks') + .reply(200, [{ + id: '99999999-9999-9999-9999-999999999999', + include: ['foo', 'bar'], + level: 'notify', + url: 'http://foobar.com' + }]) return certs.run(['--app', 'example']).then(function () { mock.done() @@ -34,8 +34,8 @@ describe('heroku webhooks:add', function () { it('# lists empty webhooks', function () { let mock = nock('https://api.heroku.com') - .get('/apps/example/webhooks') - .reply(200, []) + .get('/apps/example/webhooks') + .reply(200, []) return certs.run(['--app', 'example']).then(function () { mock.done() @@ -46,13 +46,13 @@ describe('heroku webhooks:add', function () { it('# lists pipeline webhooks', function () { let mock = nock('https://api.heroku.com') - .get('/pipelines/example/webhooks') - .reply(200, [{ - id: '99999999-9999-9999-9999-999999999999', - include: ['foo', 'bar'], - level: 'notify', - url: 'http://foobar.com', - }]) + .get('/pipelines/example/webhooks') + .reply(200, [{ + id: '99999999-9999-9999-9999-999999999999', + include: ['foo', 'bar'], + level: 'notify', + url: 'http://foobar.com' + }]) return certs.run(['--pipeline', 'example']).then(function () { mock.done() @@ -67,8 +67,8 @@ describe('heroku webhooks:add', function () { it('# lists empty pipeline webhooks', function () { let mock = nock('https://api.heroku.com') - .get('/pipelines/example/webhooks') - .reply(200, []) + .get('/pipelines/example/webhooks') + .reply(200, []) return certs.run(['--pipeline', 'example']).then(function () { mock.done() diff --git a/packages/webhooks-v5/test/commands/webhooks/info.js b/packages/webhooks-v5/test/commands/webhooks/info.js index 22ccd21d43..b871eede06 100644 --- a/packages/webhooks-v5/test/commands/webhooks/info.js +++ b/packages/webhooks-v5/test/commands/webhooks/info.js @@ -13,13 +13,13 @@ describe('heroku webhooks:deliveries:info', function () { it('# shows a webhook', function () { let mock = nock('https://api.heroku.com') - .get('/apps/example/webhooks/99999999-9999-9999-9999-999999999999') - .reply(200, { - id: '99999999-9999-9999-9999-999999999999', - include: ['foo', 'bar'], - level: 'notify', - url: 'http://foobar.com', - }) + .get('/apps/example/webhooks/99999999-9999-9999-9999-999999999999') + .reply(200, { + id: '99999999-9999-9999-9999-999999999999', + include: ['foo', 'bar'], + level: 'notify', + url: 'http://foobar.com' + }) return info.run(['99999999-9999-9999-9999-999999999999', '--app', 'example']).then(function () { mock.done() @@ -36,13 +36,13 @@ Webhook ID: 99999999-9999-9999-9999-999999999999 it('# shows a webhook (pipelines)', function () { let mock = nock('https://api.heroku.com') - .get('/pipelines/example/webhooks/99999999-9999-9999-9999-999999999999') - .reply(200, { - id: '99999999-9999-9999-9999-999999999999', - include: ['foo', 'bar'], - level: 'notify', - url: 'http://foobar.com', - }) + .get('/pipelines/example/webhooks/99999999-9999-9999-9999-999999999999') + .reply(200, { + id: '99999999-9999-9999-9999-999999999999', + include: ['foo', 'bar'], + level: 'notify', + url: 'http://foobar.com' + }) return info.run(['99999999-9999-9999-9999-999999999999', '--pipeline', 'example']).then(function () { mock.done() diff --git a/packages/webhooks-v5/test/commands/webhooks/remove.js b/packages/webhooks-v5/test/commands/webhooks/remove.js index 5857f6ccac..93cb6a1c51 100644 --- a/packages/webhooks-v5/test/commands/webhooks/remove.js +++ b/packages/webhooks-v5/test/commands/webhooks/remove.js @@ -13,8 +13,8 @@ describe('heroku webhooks:add', function () { it('# removes webhooks', function () { let mock = nock('https://api.heroku.com') - .delete('/apps/example/webhooks/99999999-9999-9999-9999-999999999999') - .reply(200, {}) + .delete('/apps/example/webhooks/99999999-9999-9999-9999-999999999999') + .reply(200, {}) return certs.run(['99999999-9999-9999-9999-999999999999', '--app', 'example']).then(function () { mock.done() @@ -25,8 +25,8 @@ describe('heroku webhooks:add', function () { it('# removes webhooks (pipelines)', function () { let mock = nock('https://api.heroku.com') - .delete('/pipelines/example/webhooks/99999999-9999-9999-9999-999999999999') - .reply(200, {}) + .delete('/pipelines/example/webhooks/99999999-9999-9999-9999-999999999999') + .reply(200, {}) return certs.run(['99999999-9999-9999-9999-999999999999', '--pipeline', 'example']).then(function () { mock.done() diff --git a/packages/webhooks-v5/test/commands/webhooks/update.js b/packages/webhooks-v5/test/commands/webhooks/update.js index 10f534c94a..4fb0a62624 100644 --- a/packages/webhooks-v5/test/commands/webhooks/update.js +++ b/packages/webhooks-v5/test/commands/webhooks/update.js @@ -13,13 +13,13 @@ describe('heroku webhooks:update', function () { it('# updates a webhook', function () { let mock = nock('https://api.heroku.com') - .patch('/apps/example/webhooks/99999999-9999-9999-9999-999999999999', { - include: ['foo', 'bar'], - level: 'notify', - secret: '1234', - url: 'http://foobar.com', - }) - .reply(200, {}) + .patch('/apps/example/webhooks/99999999-9999-9999-9999-999999999999', { + include: ['foo', 'bar'], + level: 'notify', + secret: '1234', + url: 'http://foobar.com' + }) + .reply(200, {}) return certs.run([ '99999999-9999-9999-9999-999999999999', @@ -27,7 +27,7 @@ describe('heroku webhooks:update', function () { '--include', 'foo,bar', '--secret', '1234', '--level', 'notify', - '--url', 'http://foobar.com', + '--url', 'http://foobar.com' ]).then(function () { mock.done() expect(cli.stderr).to.equal('Updating webhook 99999999-9999-9999-9999-999999999999 for example... done\n') @@ -37,13 +37,13 @@ describe('heroku webhooks:update', function () { it('# updates a webhook', function () { let mock = nock('https://api.heroku.com') - .patch('/pipelines/example/webhooks/99999999-9999-9999-9999-999999999999', { - include: ['foo', 'bar'], - level: 'notify', - secret: '1234', - url: 'http://foobar.com', - }) - .reply(200, {}) + .patch('/pipelines/example/webhooks/99999999-9999-9999-9999-999999999999', { + include: ['foo', 'bar'], + level: 'notify', + secret: '1234', + url: 'http://foobar.com' + }) + .reply(200, {}) return certs.run([ '99999999-9999-9999-9999-999999999999', @@ -51,7 +51,7 @@ describe('heroku webhooks:update', function () { '--include', 'foo,bar', '--secret', '1234', '--level', 'notify', - '--url', 'http://foobar.com', + '--url', 'http://foobar.com' ]).then(function () { mock.done() expect(cli.stderr).to.equal('Updating webhook 99999999-9999-9999-9999-999999999999 for example... done\n') diff --git a/yarn.lock b/yarn.lock index a79cbf7a9c..fef0e20b89 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1139,12 +1139,6 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" -clean-regexp@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/clean-regexp/-/clean-regexp-1.0.0.tgz#8df7c7aae51fd36874e8f8d05b9180bc11a3fed7" - dependencies: - escape-string-regexp "^1.0.5" - clean-stack@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-1.3.0.tgz#9e821501ae979986c46b1d66d2d432db2fd4ae31" @@ -1966,22 +1960,6 @@ escope@^3.6.0: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-ast-utils@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/eslint-ast-utils/-/eslint-ast-utils-1.1.0.tgz#3d58ba557801cfb1c941d68131ee9f8c34bd1586" - dependencies: - lodash.get "^4.4.2" - lodash.zip "^4.2.0" - -eslint-config-oclif@^1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/eslint-config-oclif/-/eslint-config-oclif-1.5.1.tgz#e8c5f31b8bb7383a666a506c3f6e91dbc861ecc5" - dependencies: - eslint-config-xo-space "^0.18.0" - eslint-plugin-mocha "^5.0.0" - eslint-plugin-node "^6.0.1" - eslint-plugin-unicorn "^4.0.3" - eslint-config-standard-jsx@3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/eslint-config-standard-jsx/-/eslint-config-standard-jsx-3.2.0.tgz#c240e26ed919a11a42aa4de8059472b38268d620" @@ -2006,20 +1984,6 @@ eslint-config-standard@6.2.1: version "6.2.1" resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-6.2.1.tgz#d3a68aafc7191639e7ee441e7348739026354292" -eslint-config-xo-space@^0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/eslint-config-xo-space/-/eslint-config-xo-space-0.18.0.tgz#92c8130b1ebaad9162bb822fdc8bc8e9f4fa5b8a" - dependencies: - eslint-config-xo "^0.20.0" - -eslint-config-xo@^0.20.0: - version "0.20.1" - resolved "https://registry.yarnpkg.com/eslint-config-xo/-/eslint-config-xo-0.20.1.tgz#ad04db35e62bacedcf7b7e8a76388364a78d616d" - -eslint-config-xo@^0.22.2: - version "0.22.2" - resolved "https://registry.yarnpkg.com/eslint-config-xo/-/eslint-config-xo-0.22.2.tgz#04c52a0291a320860a05a1b7333be495b255df71" - eslint-import-resolver-node@^0.2.0: version "0.2.3" resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.2.3.tgz#5add8106e8c928db2cba232bcd9efa846e3da16c" @@ -2072,21 +2036,6 @@ eslint-plugin-import@~2.9.0: minimatch "^3.0.3" read-pkg-up "^2.0.0" -eslint-plugin-mocha@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-mocha/-/eslint-plugin-mocha-5.0.0.tgz#43946a7ecaf39039eb3ee20635ebd4cc19baf6dd" - dependencies: - ramda "^0.25.0" - -eslint-plugin-node@^6.0.1, eslint-plugin-node@~6.0.0: - version "6.0.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-6.0.1.tgz#bf19642298064379315d7a4b2a75937376fa05e4" - dependencies: - ignore "^3.3.6" - minimatch "^3.0.4" - resolve "^1.3.3" - semver "^5.4.1" - eslint-plugin-node@~4.2.2: version "4.2.3" resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-4.2.3.tgz#c04390ab8dbcbb6887174023d6f3a72769e63b97" @@ -2097,6 +2046,15 @@ eslint-plugin-node@~4.2.2: resolve "^1.1.7" semver "5.3.0" +eslint-plugin-node@~6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-6.0.1.tgz#bf19642298064379315d7a4b2a75937376fa05e4" + dependencies: + ignore "^3.3.6" + minimatch "^3.0.4" + resolve "^1.3.3" + semver "^5.4.1" + eslint-plugin-promise@~3.3.0: version "3.3.2" resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-3.3.2.tgz#c1169ae6487a87cdeae44f659f4cf05131b8dc66" @@ -2154,19 +2112,6 @@ eslint-plugin-standard@~3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz#34d0c915b45edc6f010393c7eef3823b08565cf2" -eslint-plugin-unicorn@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-4.0.3.tgz#7e9998711bf237809ed1881a51a77000b2f40586" - dependencies: - clean-regexp "^1.0.0" - eslint-ast-utils "^1.0.0" - import-modules "^1.1.0" - lodash.camelcase "^4.1.1" - lodash.kebabcase "^4.0.1" - lodash.snakecase "^4.0.1" - lodash.upperfirst "^4.2.0" - safe-regex "^1.1.0" - eslint-scope@^3.7.1: version "3.7.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" @@ -2178,49 +2123,6 @@ eslint-visitor-keys@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" -eslint@^4.19.1: - version "4.19.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.19.1.tgz#32d1d653e1d90408854bfb296f076ec7e186a300" - dependencies: - ajv "^5.3.0" - babel-code-frame "^6.22.0" - chalk "^2.1.0" - concat-stream "^1.6.0" - cross-spawn "^5.1.0" - debug "^3.1.0" - doctrine "^2.1.0" - eslint-scope "^3.7.1" - eslint-visitor-keys "^1.0.0" - espree "^3.5.4" - esquery "^1.0.0" - esutils "^2.0.2" - file-entry-cache "^2.0.0" - functional-red-black-tree "^1.0.1" - glob "^7.1.2" - globals "^11.0.1" - ignore "^3.3.3" - imurmurhash "^0.1.4" - inquirer "^3.0.6" - is-resolvable "^1.0.0" - js-yaml "^3.9.1" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.4" - minimatch "^3.0.2" - mkdirp "^0.5.1" - natural-compare "^1.4.0" - optionator "^0.8.2" - path-is-inside "^1.0.2" - pluralize "^7.0.0" - progress "^2.0.0" - regexpp "^1.0.1" - require-uncached "^1.0.3" - semver "^5.3.0" - strip-ansi "^4.0.0" - strip-json-comments "~2.0.1" - table "4.0.2" - text-table "~0.2.0" - eslint@~3.10.2: version "3.10.2" resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.10.2.tgz#c9a10e8bf6e9d65651204778c503341f1eac3ce7" @@ -2380,7 +2282,7 @@ eslint@~4.18.0: table "4.0.2" text-table "~0.2.0" -espree@^3.3.1, espree@^3.4.0, espree@^3.5.2, espree@^3.5.4: +espree@^3.3.1, espree@^3.4.0, espree@^3.5.2: version "3.5.4" resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" dependencies: @@ -3278,10 +3180,6 @@ ignore@^3.0.11, ignore@^3.0.9, ignore@^3.1.5, ignore@^3.2.0, ignore@^3.3.3, igno version "3.3.8" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.8.tgz#3f8e9c35d38708a3a7e0e9abb6c73e7ee7707b2b" -import-modules@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/import-modules/-/import-modules-1.1.0.tgz#748db79c5cc42bb9701efab424f894e72600e9dc" - imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -4019,10 +3917,6 @@ lodash.ary@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.ary/-/lodash.ary-4.1.1.tgz#66065fa91bacc7a034d9c8fce52f83d3c7e40212" -lodash.camelcase@^4.1.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" - lodash.cond@^4.3.0: version "4.5.2" resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5" @@ -4051,10 +3945,6 @@ lodash.identity@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash.identity/-/lodash.identity-3.0.0.tgz#ad7bc6a4e647d79c972e1b80feef7af156267876" -lodash.kebabcase@^4.0.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz#8489b1cb0d29ff88195cceca448ff6d6cc295c36" - lodash.keys@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-4.2.0.tgz#a08602ac12e4fb83f91fc1fb7a360a4d9ba35205" @@ -4103,10 +3993,6 @@ lodash.result@^4.5.2: version "4.5.2" resolved "https://registry.yarnpkg.com/lodash.result/-/lodash.result-4.5.2.tgz#cb45b27fb914eaa8d8ee6f0ce7b2870b87cb70aa" -lodash.snakecase@^4.0.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" - lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" @@ -4124,14 +4010,6 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "~3.0.0" -lodash.upperfirst@^4.2.0: - version "4.3.1" - resolved "https://registry.yarnpkg.com/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce" - -lodash.zip@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.zip/-/lodash.zip-4.2.0.tgz#ec6662e4896408ed4ab6c542a3990b72cc080020" - lodash@4.17.10, lodash@^4.0.0, lodash@^4.11.1, lodash@^4.17.10, lodash@^4.17.2, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1, lodash@^4.3.0, lodash@^4.5.1, lodash@~4.17.2: version "4.17.10" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" @@ -5125,10 +5003,6 @@ quick-lru@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" -ramda@^0.25.0: - version "0.25.0" - resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.25.0.tgz#8fdf68231cffa90bc2f9460390a0cb74a29b29a9" - rc@^1.0.1, rc@^1.1.6: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" @@ -5266,10 +5140,6 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexpp@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab" - registry-auth-token@^3.0.1: version "3.3.2" resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.3.2.tgz#851fd49038eecb586911115af845260eec983f20"