1
- import { ux } from '@oclif/core '
1
+ import { hux } from '@heroku/heroku-cli-util '
2
2
import { expect , test } from '@oclif/test'
3
- import ConfirmCommand from '../../../src/lib/confirmCommand.js'
4
3
import stripAnsi from 'strip-ansi'
5
4
5
+ import ConfirmCommand from '../../../src/lib/confirmCommand.js'
6
+
6
7
describe ( 'confirmApp' , function ( ) {
7
8
test
8
9
. stdout ( )
@@ -25,7 +26,7 @@ describe('confirmApp', function () {
25
26
test
26
27
. stdout ( )
27
28
. stderr ( )
28
- . stub ( ux , 'prompt' , ( ) => Promise . resolve ( 'app' ) )
29
+ . stub ( hux , 'prompt' , ( ) => Promise . resolve ( 'app' ) )
29
30
. do ( ( ) => new ConfirmCommand ( ) . confirm ( 'app' ) )
30
31
. it ( 'should not err on confirm prompt match' , ( { stderr, stdout} ) => {
31
32
expect ( stderr ) . to . contain ( 'Warning: WARNING: Destructive Action' )
@@ -37,15 +38,15 @@ describe('confirmApp', function () {
37
38
test
38
39
. stdout ( )
39
40
. stderr ( )
40
- . stub ( ux , 'prompt' , ( ) => Promise . resolve ( 'app' ) )
41
+ . stub ( hux , 'prompt' , ( ) => Promise . resolve ( 'app' ) )
41
42
. do ( ( ) => new ConfirmCommand ( ) . confirm ( 'app' , undefined , customMessage ) )
42
43
. it ( 'should display custom message' , ( { stderr, stdout} ) => {
43
44
expect ( stderr ) . to . contain ( customMessage )
44
45
expect ( stdout ) . to . equal ( '' )
45
46
} )
46
47
47
48
test
48
- . stub ( ux , 'prompt' , ( ) => Promise . resolve ( 'nope' ) )
49
+ . stub ( hux , 'prompt' , ( ) => Promise . resolve ( 'nope' ) )
49
50
. do ( ( ) => new ConfirmCommand ( ) . confirm ( 'app' ) )
50
51
. catch ( ( error : Error ) => {
51
52
expect ( stripAnsi ( error . message ) ) . to . equal ( 'Confirmation did not match app. Aborted.' )
0 commit comments