Fix tests

This commit is contained in:
Yemel Jardi 2014-12-10 17:50:46 -03:00
parent 3fa3e0b691
commit d584febea0
2 changed files with 6 additions and 4 deletions

View File

@ -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);

View File

@ -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() {