Skip to content

Commit dfd5832

Browse files
committed
test: migrate pipelines/rename to @oclif/test v4
1 parent ce66cdd commit dfd5832

File tree

2 files changed

+25
-21
lines changed

2 files changed

+25
-21
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import {expect} from 'chai'
2+
import {runCommand} from '@oclif/test'
3+
import nock from 'nock'
4+
5+
describe('pipelines:rename', function () {
6+
const oldName = 'polaris'
7+
const newName = 'vega'
8+
const id = '12345'
9+
10+
afterEach(function () {
11+
nock.cleanAll()
12+
})
13+
14+
it('displays the right messages', async function () {
15+
nock('https://api.heroku.com')
16+
.get(`/pipelines?eq[name]=${oldName}`)
17+
.reply(200, [{id, name: oldName}])
18+
.patch(`/pipelines/${id}`)
19+
.reply(200, {id, name: newName})
20+
21+
const {stderr} = await runCommand(['pipelines:rename', oldName, newName])
22+
23+
expect(stderr).to.include(`Renaming ${oldName} pipeline to ${newName}... done`)
24+
})
25+
})

packages/cli/test/unit/commands/pipelines/rename.unit.test.ts.skip

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)