From 262f220d89a2051e2c3bfc02dd73471a1e467e41 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Tue, 3 Mar 2020 11:18:05 -0500 Subject: [PATCH] fix: fix tests --- test/escrow_spec.js | 8 ++++++-- utils/testUtils.js | 5 ----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/test/escrow_spec.js b/test/escrow_spec.js index 8c654af4..3221c993 100644 --- a/test/escrow_spec.js +++ b/test/escrow_spec.js @@ -1,4 +1,4 @@ -/*global contract, config, it, assert, web3, before, describe, beforeEach, artifacts*/ +/*global contract, config, assert, web3, artifacts, increaseTime, before*/ /* eslint no-await-in-loop: 0 */ const TestUtils = require("../utils/testUtils"); @@ -102,7 +102,11 @@ contract("Escrow", function() { // util const expireTransaction = async() => { const addTime = 5 * 86400; - await TestUtils.increaseTime(addTime + 1); + try { + await increaseTime(addTime + 1); + } catch (e) { + console.error('Error with the increase time', e); + } }; let receipt, escrowId, escrowTokenId, _offerId, sntOfferId, ethOfferId, tokenOfferId, hash, signature, nonce; diff --git a/utils/testUtils.js b/utils/testUtils.js index d15b85dc..3e765f72 100644 --- a/utils/testUtils.js +++ b/utils/testUtils.js @@ -140,8 +140,3 @@ exports.evmRevert = (id) => { const params = [id]; return evmMethod("evm_revert", params); }; - -exports.increaseTime = async (amount) => { - await evmMethod("evm_increaseTime", [Number(amount)]); - await evmMethod("evm_mine"); -};