Browse Source

Merge pull request #703 from yemel/fix/tests

Fix tests
patch-2
Esteban Ordano 10 years ago
parent
commit
1dfb7f1d02
  1. 4
      test/hdprivatekey.js
  2. 6
      test/util/preconditions.js

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

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

Loading…
Cancel
Save