aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/unit/app/controllers/transactions/tx-state-manager-test.js9
-rw-r--r--test/unit/app/nodeify-test.js9
2 files changed, 12 insertions, 6 deletions
diff --git a/test/unit/app/controllers/transactions/tx-state-manager-test.js b/test/unit/app/controllers/transactions/tx-state-manager-test.js
index 2509c11fb..f4b287634 100644
--- a/test/unit/app/controllers/transactions/tx-state-manager-test.js
+++ b/test/unit/app/controllers/transactions/tx-state-manager-test.js
@@ -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)
diff --git a/test/unit/app/nodeify-test.js b/test/unit/app/nodeify-test.js
index e21654a7b..938b76c68 100644
--- a/test/unit/app/nodeify-test.js
+++ b/test/unit/app/nodeify-test.js
@@ -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()))
+ }
})
})