Navigation Menu

Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
fix(disputes unit test): use custom try/catch for test of getUserDisp…
Browse files Browse the repository at this point in the history
…uteFromStore
  • Loading branch information
satello committed Mar 27, 2018
1 parent c741454 commit cb386f1
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions 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 = {}
Expand Down Expand Up @@ -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)
)
})
})
Expand Down

0 comments on commit cb386f1

Please sign in to comment.