Skip to content
Permalink
Browse files

fix(disputes unit test): use custom try/catch for test of getUserDisp…

…uteFromStore
  • Loading branch information...
satello committed Mar 23, 2018
1 parent c7bc79b commit b10ca1a356b1bb49088bd4d6e5c6e23a92726dc2
Showing with 13 additions and 4 deletions.
  1. +13 −4 tests/unit/abstractWrappers/Disputes.test.js
@@ -1,6 +1,5 @@
import { expectThrow } from 'kleros-interaction/helpers/utils'

import DisputesApi from '../../../src/abstractWrappers/Disputes'
import * as errorConstants from '../../../src/constants/error'

describe('Disputes', () => {
let mockArbitratorWrapper = {}
@@ -394,12 +393,22 @@ describe('Disputes', () => {

disputesInstance.setStoreProvider(mockStoreProvider)

expectThrow(
disputesInstance.getUserDisputeFromStore(
let didThrow = false
let error
try {
await disputesInstance.getUserDisputeFromStore(
mockDispute.arbitratorAddress,
mockDispute.disputeId + 1,
account
)
} catch (err) {
didThrow = true
error = err
}

expect(didThrow).toBeTruthy()
expect(error.message).toEqual(
errorConstants.NO_STORE_DATA_FOR_DISPUTE(account)
)
})
})

0 comments on commit b10ca1a

Please sign in to comment.
You can’t perform that action at this time.