From d584febea027c45d8307025fe79b42ca871efb8e Mon Sep 17 00:00:00 2001 From: Yemel Jardi Date: Wed, 10 Dec 2014 17:50:46 -0300 Subject: [PATCH] Fix tests --- test/hdprivatekey.js | 4 ++-- test/util/preconditions.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/hdprivatekey.js b/test/hdprivatekey.js index 80037cbfc..c1329f9ac 100644 --- a/test/hdprivatekey.js +++ b/test/hdprivatekey.js @@ -47,7 +47,7 @@ describe('HDPrivate key interface', function() { }; it('should make a new private key from random', function() { - (new HDPrivateKey().xprivkey).should.exist(); + should.exist(new HDPrivateKey().xprivkey); }); it('should error with an invalid checksum', function() { @@ -135,7 +135,7 @@ describe('HDPrivate key interface', function() { describe('on creation from seed', function() { it('converts correctly from an hexa string', function() { - HDPrivateKey.fromSeed('01234567890abcdef01234567890abcdef').xprivkey.should.exist(); + should.exist(HDPrivateKey.fromSeed('01234567890abcdef01234567890abcdef').xprivkey); }); it('fails when argument is not a buffer or string', function() { expectSeedFail(1, hdErrors.InvalidEntropyArgument); diff --git a/test/util/preconditions.js b/test/util/preconditions.js index 653b1843c..0ccea83b9 100644 --- a/test/util/preconditions.js +++ b/test/util/preconditions.js @@ -1,5 +1,7 @@ 'use strict'; +var should = require('chai').should(); + var errors = require('../../lib/errors'); var $ = require('../../lib/util/preconditions'); var PrivateKey = require('../../lib/privatekey'); @@ -35,7 +37,7 @@ describe('preconditions', function() { error = e; e.message.should.equal('Invalid Argument for argumentName, expected string but got number'); } - error.should.exist(); + should.exist(error); }); it('has no false negatives when used to check an argument type', function() { (function() { @@ -51,7 +53,7 @@ describe('preconditions', function() { error = e; e.message.should.equal('Invalid Argument for (unknown name), expected PrivateKey but got number'); } - error.should.exist(); + should.exist(error); }); it('has no false negatives when checking a type for a class', function() { (function() {