UNPKG

753 BJavaScriptView Raw
1/* eslint-env mocha */
2
3const nock = require('nock')
4const cli = require('heroku-cli-util')
5const cmd = require('../../../commands/ci/config-unset')
6
7describe('heroku ci:config:unset', function () {
8 let app, coupling, key
9
10 beforeEach(function () {
11 cli.mockConsole()
12 app = '123-app'
13 key = 'FOO'
14
15 coupling = {
16 pipeline: {
17 id: '123-abc',
18 name: 'test-pipeline'
19 }
20 }
21 })
22
23 it('unsets config', function* () {
24 const api = nock('https://api.heroku.com')
25 .get(`/apps/${app}/pipeline-couplings`)
26 .reply(200, coupling)
27 .patch(`/pipelines/${coupling.pipeline.id}/stage/test/config-vars`)
28 .reply(200, { [key]: null })
29
30 yield cmd.run({ app, args: [ key ] })
31
32 api.done()
33 })
34})