@@ -224,7 +224,7 @@ describe("NodeConnection", () => {
224
224
client . fetchRaw = async ( ) => {
225
225
attemptCount ++ ;
226
226
console . warn ( `fake fetchRaw attempt ${ attemptCount } ` ) ;
227
- throw new Error ( "503 Service Unavailable" ) ;
227
+ throw Object . assign ( new Error ( "503 Service Unavailable" ) , { status : 503 } ) ;
228
228
} ;
229
229
230
230
try {
@@ -237,25 +237,25 @@ describe("NodeConnection", () => {
237
237
} ) ;
238
238
239
239
it ( "should retry failed transaction submissions and eventually give up" , async ( ) => {
240
- const client = new AleoNetworkClient ( "http://localhost:1234" ) ;
241
-
242
- let attemptCount = 0 ;
243
-
244
- // @ts -ignore override for testing
245
- client [ "sendPost" ] = async ( ) => {
246
- attemptCount ++ ;
247
- console . warn ( `fake sendPost attempt ${ attemptCount } ` ) ;
248
- throw new Error ( "503 Service Unavailable" ) ;
249
- } ;
250
-
251
- try {
252
- await client . submitTransaction ( "dummy_tx_string" ) ;
253
- throw new Error ( "Expected submitTransaction to fail" ) ;
254
- } catch ( err : any ) {
255
- expect ( err . message ) . to . include ( "503" ) ;
256
- expect ( attemptCount ) . to . be . greaterThan ( 1 ) ;
257
- }
258
- } ) ;
240
+ const client = new AleoNetworkClient ( "http://localhost:1234" ) ;
241
+
242
+ let attemptCount = 0 ;
243
+
244
+ // @ts -ignore override for testing
245
+ client [ "sendPost" ] = async ( ) => {
246
+ attemptCount ++ ;
247
+ console . warn ( `fake sendPost attempt ${ attemptCount } ` ) ;
248
+ throw Object . assign ( new Error ( "503 Service Unavailable" ) , { status : 503 } ) ;
249
+ } ;
250
+
251
+ try {
252
+ await client . submitTransaction ( "dummy_tx_string" ) ;
253
+ throw new Error ( "Expected submitTransaction to fail" ) ;
254
+ } catch ( err : any ) {
255
+ expect ( err . message ) . to . include ( "503" ) ;
256
+ expect ( attemptCount ) . to . be . greaterThan ( 1 ) ;
257
+ }
258
+ } ) ;
259
259
} ) ;
260
260
261
261
describe ( "setHeader" , ( ) => {
0 commit comments