bitcore/test/test.Key.js

36 lines
724 B
JavaScript
Raw Normal View History

2014-02-19 11:07:50 -08:00
'use strict';
var chai = require('chai');
var bitcore = require('../bitcore');
var should = chai.should();
2014-02-19 11:54:41 -08:00
var KeyModule = bitcore.KeyModule;
var Key;
describe('Key', function() {
2014-02-19 11:07:50 -08:00
it('should initialze the main object', function() {
2014-02-19 11:54:41 -08:00
should.exist(KeyModule);
});
it('should be able to create class', function() {
Key = KeyModule.Key;
2014-02-19 11:07:50 -08:00
should.exist(Key);
});
it('should be able to create instance', function() {
var k = new Key();
should.exist(k);
});
2014-02-20 13:59:41 -08:00
it('should be able to generateSync instance', function() {
var k = Key.generateSync();
should.exist(k);
k.private.length.should.equal(32);
k.public.length.should.equal(33);
should.exist(k.compressed);
});
2014-02-19 11:07:50 -08:00
});