mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
fix tests
This commit is contained in:
parent
b4107a505b
commit
c734e486a0
@ -57,9 +57,12 @@ describe('TransactionStateManager', function () {
|
|||||||
const tx = { id: 1, status: 'unapproved', metamaskNetworkId: currentNetworkId, txParams: {} }
|
const tx = { id: 1, status: 'unapproved', metamaskNetworkId: currentNetworkId, txParams: {} }
|
||||||
txStateManager.addTx(tx)
|
txStateManager.addTx(tx)
|
||||||
const noop = function (err, txId) {
|
const noop = function (err, txId) {
|
||||||
assert(err, null)
|
if (!err) {
|
||||||
assert(true, 'event listener has been triggered and noop executed')
|
assert(true, 'event listener has been triggered and noop executed')
|
||||||
done()
|
done()
|
||||||
|
} else {
|
||||||
|
done(new Error(err.toString()))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
txStateManager.on('1:rejected', noop)
|
txStateManager.on('1:rejected', noop)
|
||||||
txStateManager.setTxStatusRejected(1)
|
txStateManager.setTxStatusRejected(1)
|
||||||
|
@ -13,9 +13,12 @@ describe('nodeify', function () {
|
|||||||
it('should retain original context', function (done) {
|
it('should retain original context', function (done) {
|
||||||
var nodified = nodeify(obj.promiseFunc, obj)
|
var nodified = nodeify(obj.promiseFunc, obj)
|
||||||
nodified('baz', function (err, res) {
|
nodified('baz', function (err, res) {
|
||||||
assert(err, null)
|
if (!err) {
|
||||||
assert.equal(res, 'barbaz')
|
assert.equal(res, 'barbaz')
|
||||||
done()
|
done()
|
||||||
|
} else {
|
||||||
|
done(new Error(err.toString()))
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user