diff --git a/test/test.Script.js b/test/test.Script.js index 9bb3ef2..df03ae5 100644 --- a/test/test.Script.js +++ b/test/test.Script.js @@ -5,19 +5,15 @@ var bitcore = bitcore || require('../bitcore'); var should = chai.should(); -var ScriptModule = bitcore.Script; +var Script = bitcore.Script; var Address = bitcore.Address; var Opcode = bitcore.Opcode; +var Transaction = bitcore.Transaction; var networks = bitcore.networks; -var Script; var testdata = testdata || require('./testdata'); describe('Script', function() { - it('should initialze the main object', function() { - should.exist(ScriptModule); - }); it('should be able to create class', function() { - Script = ScriptModule; should.exist(Script); }); it('should be able to create instance', function() { @@ -151,7 +147,6 @@ describe('Script', function() { describe('#countMissingSignatures', function() { - Script = ScriptModule; it('should count missing signature in empty scripts', function() { var s = new Script(); s.countMissingSignatures().should.equal(1); @@ -201,7 +196,12 @@ describe('Script', function() { var testF = function(raw, expected) { var s = new Script(new Buffer(raw, 'hex')); var actual = f.bind(s)(); - actual.should.equal(expected); + if (expected !== null) { + should.exist(actual); + actual.should.equal(expected); + } else { + should.not.exist(actual); + } }; return testF; }; @@ -289,21 +289,41 @@ describe('Script', function() { var s = new Script(new Buffer(raw, 'hex')); var actual = s.getSignatures(); actual.length.should.equal(expected.length); - for (var i=0; i