Merge pull request #786 from maraoz/remove/outdated-test

Remove outdated test and update .jshintrc
This commit is contained in:
Braydon Fuller 2014-12-17 09:44:14 -05:00
commit 158ed98e71
2 changed files with 17 additions and 18 deletions

View File

@ -10,7 +10,7 @@
"immed": true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );` "immed": true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
"indent": 2, // Specify indentation spacing "indent": 2, // Specify indentation spacing
"latedef": true, // Prohibit variable use before definition. "latedef": true, // Prohibit variable use before definition.
"newcap": false, // Require capitalization of all constructor functions e.g. `new F()`. "newcap": true, // Require capitalization of all constructor functions e.g. `new F()`.
"noarg": true, // Prohibit use of `arguments.caller` and `arguments.callee`. "noarg": true, // Prohibit use of `arguments.caller` and `arguments.callee`.
"node": true, // Enable globals available when code is running inside of the NodeJS runtime environment. "node": true, // Enable globals available when code is running inside of the NodeJS runtime environment.
"noempty": true, // Prohibit use of empty blocks. "noempty": true, // Prohibit use of empty blocks.

View File

@ -23,7 +23,9 @@ describe("ECDSA", function() {
describe('#set', function() { describe('#set', function() {
it('should set hashbuf', function() { it('should set hashbuf', function() {
should.exist(ECDSA().set({hashbuf: ecdsa.hashbuf}).hashbuf); should.exist(ECDSA().set({
hashbuf: ecdsa.hashbuf
}).hashbuf);
}); });
}); });
@ -44,7 +46,10 @@ describe("ECDSA", function() {
var ecdsa = new ECDSA({ var ecdsa = new ECDSA({
privkey: Privkey(BN().fromBuffer(Hash.sha256(new Buffer('test')))), privkey: Privkey(BN().fromBuffer(Hash.sha256(new Buffer('test')))),
hashbuf: hashbuf, hashbuf: hashbuf,
sig: new Signature({r: r, s: s}) sig: new Signature({
r: r,
s: s
})
}); });
ecdsa.calci(); ecdsa.calci();
@ -151,12 +156,6 @@ describe("ECDSA", function() {
ecdsa.sigError().should.equal('hashbuf must be a 32 byte buffer'); ecdsa.sigError().should.equal('hashbuf must be a 32 byte buffer');
}); });
it.skip('should return an error if the pubkey is invalid', function() {
var ecdsa = new ECDSA();
ecdsa.hashbuf = Hash.sha256(new Buffer('test'));
ecdsa.sigError().indexOf("Invalid pubkey").should.equal(0);
});
it('should return an error if r, s are invalid', function() { it('should return an error if r, s are invalid', function() {
var ecdsa = new ECDSA(); var ecdsa = new ECDSA();
ecdsa.hashbuf = Hash.sha256(new Buffer('test')); ecdsa.hashbuf = Hash.sha256(new Buffer('test'));