@@ -155,8 +155,8 @@ describe('NetworkCommand unit tests', () => {
155
155
156
156
it ( 'Install function is called with expected parameters' , async ( ) => {
157
157
const networkCommand = new NetworkCommand ( opts ) ;
158
- sinon . stub ( networkCommand , 'getConsensusNodes' ) . resolves ( [ ] ) ;
159
- sinon . stub ( networkCommand , 'getContexts' ) . resolves ( [ ] ) ;
158
+ sinon . stub ( networkCommand , 'getConsensusNodes' ) . returns ( [ ] ) ;
159
+ sinon . stub ( networkCommand , 'getContexts' ) . returns ( [ ] ) ;
160
160
await networkCommand . deploy ( argv ) ;
161
161
162
162
expect ( opts . chartManager . install . args [ 0 ] [ 0 ] . name ) . to . equal ( constants . SOLO_TEST_CLUSTER ) ;
@@ -168,19 +168,23 @@ describe('NetworkCommand unit tests', () => {
168
168
} ) ;
169
169
170
170
it ( 'Should use local chart directory' , async ( ) => {
171
- argv [ flags . chartDirectory . name ] = 'test-directory' ;
172
- argv [ flags . force . name ] = true ;
173
-
174
- const networkCommand = new NetworkCommand ( opts ) ;
175
- sinon . stub ( networkCommand , 'getConsensusNodes' ) . resolves ( [ ] ) ;
176
- sinon . stub ( networkCommand , 'getContexts' ) . resolves ( [ ] ) ;
177
- await networkCommand . deploy ( argv ) ;
178
- expect ( opts . chartManager . install . args [ 0 ] [ 0 ] . name ) . to . equal ( constants . SOLO_TEST_CLUSTER ) ;
179
- expect ( opts . chartManager . install . args [ 0 ] [ 1 ] ) . to . equal ( constants . SOLO_DEPLOYMENT_CHART ) ;
180
- expect ( opts . chartManager . install . args [ 0 ] [ 2 ] ) . to . equal (
181
- path . join ( ROOT_DIR , 'test-directory' , constants . SOLO_DEPLOYMENT_CHART ) ,
182
- ) ;
183
- expect ( opts . chartManager . install . args [ 0 ] [ 3 ] ) . to . equal ( version . SOLO_CHART_VERSION ) ;
171
+ try {
172
+ argv [ flags . chartDirectory . name ] = 'test-directory' ;
173
+ argv [ flags . force . name ] = true ;
174
+
175
+ sinon . stub ( NetworkCommand . prototype , 'getConsensusNodes' ) . returns ( [ ] ) ;
176
+ sinon . stub ( NetworkCommand . prototype , 'getContexts' ) . returns ( [ ] ) ;
177
+ const networkCommand = new NetworkCommand ( opts ) ;
178
+ await networkCommand . deploy ( argv ) ;
179
+ expect ( opts . chartManager . install . args [ 0 ] [ 0 ] . name ) . to . equal ( constants . SOLO_TEST_CLUSTER ) ;
180
+ expect ( opts . chartManager . install . args [ 0 ] [ 1 ] ) . to . equal ( constants . SOLO_DEPLOYMENT_CHART ) ;
181
+ expect ( opts . chartManager . install . args [ 0 ] [ 2 ] ) . to . equal (
182
+ path . join ( ROOT_DIR , 'test-directory' , constants . SOLO_DEPLOYMENT_CHART ) ,
183
+ ) ;
184
+ expect ( opts . chartManager . install . args [ 0 ] [ 3 ] ) . to . equal ( version . SOLO_CHART_VERSION ) ;
185
+ } finally {
186
+ sinon . restore ( ) ;
187
+ }
184
188
} ) ;
185
189
186
190
it ( 'Should use prepare config correctly for all clusters' , async ( ) => {
0 commit comments