Skip to content

Commit 46ef07a

Browse files
committed
fix confirm command test
1 parent f1c92fc commit 46ef07a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

packages/cli/test/unit/lib/confirm-command.unit.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import {ux} from '@oclif/core'
1+
import {hux} from '@heroku/heroku-cli-util'
22
import {expect, test} from '@oclif/test'
3-
import ConfirmCommand from '../../../src/lib/confirmCommand.js'
43
import stripAnsi from 'strip-ansi'
54

5+
import ConfirmCommand from '../../../src/lib/confirmCommand.js'
6+
67
describe('confirmApp', function () {
78
test
89
.stdout()
@@ -25,7 +26,7 @@ describe('confirmApp', function () {
2526
test
2627
.stdout()
2728
.stderr()
28-
.stub(ux, 'prompt', () => Promise.resolve('app'))
29+
.stub(hux, 'prompt', () => Promise.resolve('app'))
2930
.do(() => new ConfirmCommand().confirm('app'))
3031
.it('should not err on confirm prompt match', ({stderr, stdout}) => {
3132
expect(stderr).to.contain('Warning: WARNING: Destructive Action')
@@ -37,15 +38,15 @@ describe('confirmApp', function () {
3738
test
3839
.stdout()
3940
.stderr()
40-
.stub(ux, 'prompt', () => Promise.resolve('app'))
41+
.stub(hux, 'prompt', () => Promise.resolve('app'))
4142
.do(() => new ConfirmCommand().confirm('app', undefined, customMessage))
4243
.it('should display custom message', ({stderr, stdout}) => {
4344
expect(stderr).to.contain(customMessage)
4445
expect(stdout).to.equal('')
4546
})
4647

4748
test
48-
.stub(ux, 'prompt', () => Promise.resolve('nope'))
49+
.stub(hux, 'prompt', () => Promise.resolve('nope'))
4950
.do(() => new ConfirmCommand().confirm('app'))
5051
.catch((error: Error) => {
5152
expect(stripAnsi(error.message)).to.equal('Confirmation did not match app. Aborted.')

0 commit comments

Comments
 (0)