@@ -4,15 +4,7 @@ import * as sinon from 'sinon'
44
55import { ScConnection } from '../../../../src/util/sc-connection.js'
66
7- describe ( 'missionctrl:broker:create' , ( ) => {
8- let scConnPostStub : any
9- let scConnGetStub : any
10- let envName : string = 'MyTestEnvironment'
11- let brokerName : string = 'MyEventBrokerName'
12- let brokerDC : string = 'eks-ca-central-1a'
13- let brokerSvcClassId : string = 'DEVELOPER'
14-
15- function anEnv ( name : string , isDefault : boolean , isProd : boolean ) {
7+ function anEnv ( name : string , isDefault : boolean , isProd : boolean ) {
168 return {
179 bgColor : '#DA162D' ,
1810 createdBy : 'someuser' ,
@@ -29,10 +21,18 @@ describe('missionctrl:broker:create', () => {
2921 }
3022}
3123
24+ describe ( 'missionctrl:broker:create' , ( ) => {
25+ let scConnPostStub : sinon . SinonStub
26+ let scConnGetStub : sinon . SinonStub
27+ const envName : string = 'MyTestEnvironment'
28+ const brokerName : string = 'MyEventBrokerName'
29+ const brokerDC : string = 'eks-ca-central-1a'
30+ const brokerSvcClassId : string = 'DEVELOPER'
31+
3232 beforeEach ( ( ) => {
33- scConnPostStub = sinon . stub ( ScConnection . prototype , < any > 'post' )
34- scConnGetStub = sinon . stub ( ScConnection . prototype , < any > 'get' )
35- } ) ;
33+ scConnPostStub = sinon . stub ( ScConnection . prototype , 'post' )
34+ scConnGetStub = sinon . stub ( ScConnection . prototype , 'get' )
35+ } )
3636
3737 afterEach ( ( ) => {
3838 scConnPostStub . restore ( )
@@ -45,7 +45,7 @@ describe('missionctrl:broker:create', () => {
4545 } )
4646
4747 it ( `runs missionctrl:broker:create -n ${ brokerName } -d ${ brokerDC } -c ${ brokerSvcClassId } ` , async ( ) => {
48- let createOutputMsg = 'Event broker service created successfully.'
48+ const createOutputMsg = 'Event broker service created successfully.'
4949 scConnPostStub . returns ( createOutputMsg )
5050
5151 const { stdout } = await runCommand ( `missionctrl:broker:create -n ${ brokerName } -d ${ brokerDC } -c ${ brokerSvcClassId } ` )
@@ -68,8 +68,8 @@ describe('missionctrl:broker:create', () => {
6868 }
6969 }
7070 scConnGetStub . returns ( Promise . resolve ( envs ) )
71-
72- let createOutputMsg = 'Event broker service created successfully.'
71+
72+ const createOutputMsg = 'Event broker service created successfully.'
7373 scConnPostStub . returns ( createOutputMsg )
7474
7575 const { stdout } = await runCommand ( `missionctrl:broker:create -e ${ envName } -n ${ brokerName } -d ${ brokerDC } -c ${ brokerSvcClassId } ` )
0 commit comments