Ryan X. Charles
11 years ago
13 changed files with 140 additions and 14 deletions
@ -0,0 +1,5 @@ |
|||
|
|||
// load modules needed for testing in the browser
|
|||
|
|||
var fs = require('fs'); |
|||
|
@ -0,0 +1,36 @@ |
|||
'use strict'; |
|||
|
|||
var chai = require('chai'); |
|||
var bitcore = require('../bitcore'); |
|||
|
|||
var should = chai.should(); |
|||
|
|||
var AddressModule = bitcore.Address; |
|||
var Address; |
|||
|
|||
describe('Address', function() { |
|||
it('should initialze the main object', function() { |
|||
should.exist(AddressModule); |
|||
}); |
|||
it('should be able to create class', function() { |
|||
Address = AddressModule.class(); |
|||
should.exist(Address); |
|||
}); |
|||
it('should be able to create Address object', function() { |
|||
var a = new Address('1KfyjCgBSMsLqiCbakfSdeoBUqMqLUiu3T'); |
|||
should.exist(a); |
|||
}); |
|||
it('should validate correctly', function() { |
|||
var a = new Address("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"); |
|||
var m = new Address("32QBdjycLwbDTuGafUwaU5p5GxzSLPYoF6"); |
|||
var b = new Address("11111111111111111111111111122222234"); |
|||
a.validate.bind(a).should.not.throw(Error); |
|||
m.validate.bind(m).should.not.throw(Error); |
|||
b.validate.bind(b).should.throw(Error); |
|||
}); |
|||
}); |
|||
|
|||
|
|||
|
|||
|
|||
|
@ -0,0 +1,28 @@ |
|||
'use strict'; |
|||
|
|||
var chai = require('chai'); |
|||
var bitcore = require('../bitcore'); |
|||
|
|||
var should = chai.should(); |
|||
|
|||
var EncodedDataModule = bitcore.EncodedData; |
|||
var EncodedData; |
|||
|
|||
describe('EncodedData', function() { |
|||
it('should initialze the main object', function() { |
|||
should.exist(EncodedDataModule); |
|||
}); |
|||
it('should be able to create class', function() { |
|||
EncodedData = EncodedDataModule.class(); |
|||
should.exist(EncodedData); |
|||
}); |
|||
it('should be able to create an instance', function() { |
|||
var ed = new EncodedData('1GMx4HdDmN78xzGvdQYkwrVqkmLDG1aMNT'); |
|||
should.exist(ed); |
|||
}); |
|||
}); |
|||
|
|||
|
|||
|
|||
|
|||
|
@ -0,0 +1,34 @@ |
|||
'use strict'; |
|||
|
|||
var chai = require('chai'); |
|||
var bitcore = require('../bitcore'); |
|||
|
|||
var should = chai.should(); |
|||
|
|||
var VersionedDataModule = bitcore.VersionedData; |
|||
var VersionedData; |
|||
|
|||
describe('VersionedData', function() { |
|||
it('should initialze the main object', function() { |
|||
should.exist(VersionedDataModule); |
|||
}); |
|||
it('should be able to create class', function() { |
|||
VersionedData = VersionedDataModule.class(); |
|||
should.exist(VersionedData); |
|||
}); |
|||
it('should be able to create an instance', function() { |
|||
var vd = new VersionedData(); |
|||
should.exist(vd); |
|||
}); |
|||
it('should get correct version', function() { |
|||
var vda = new VersionedData('1GMx4HdDmN78xzGvdQYkwrVqkmLDG1aMNT'); |
|||
var vdb = new VersionedData('3746djr32k2Lp23UUbdkCTQ6zhMJ7d8MD7'); |
|||
vda.version().should.equal(0); |
|||
vdb.version().should.equal(5); |
|||
}); |
|||
}); |
|||
|
|||
|
|||
|
|||
|
|||
|
@ -1,3 +1,4 @@ |
|||
'use strict'; |
|||
var assert = require('assert'); |
|||
var fs = require('fs'); |
|||
|
Loading…
Reference in new issue