1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00

fix tests

This commit is contained in:
brunobar79 2018-07-02 20:21:27 -04:00
parent b4107a505b
commit c734e486a0
2 changed files with 12 additions and 6 deletions

View File

@ -57,9 +57,12 @@ describe('TransactionStateManager', function () {
const tx = { id: 1, status: 'unapproved', metamaskNetworkId: currentNetworkId, txParams: {} }
txStateManager.addTx(tx)
const noop = function (err, txId) {
assert(err, null)
assert(true, 'event listener has been triggered and noop executed')
done()
if (!err) {
assert(true, 'event listener has been triggered and noop executed')
done()
} else {
done(new Error(err.toString()))
}
}
txStateManager.on('1:rejected', noop)
txStateManager.setTxStatusRejected(1)

View File

@ -13,9 +13,12 @@ describe('nodeify', function () {
it('should retain original context', function (done) {
var nodified = nodeify(obj.promiseFunc, obj)
nodified('baz', function (err, res) {
assert(err, null)
assert.equal(res, 'barbaz')
done()
if (!err) {
assert.equal(res, 'barbaz')
done()
} else {
done(new Error(err.toString()))
}
})
})