From e61aa8528f402a909da91178e5e017a722f8ecc2 Mon Sep 17 00:00:00 2001 From: "Ryan X. Charles" Date: Fri, 11 Apr 2014 14:23:19 -0300 Subject: [PATCH] add some tests to make sure changes to Key C++ code work as expected --- test/test.Key.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/test.Key.js b/test/test.Key.js index aa412560e..9eb988239 100644 --- a/test/test.Key.js +++ b/test/test.Key.js @@ -16,6 +16,21 @@ describe('Key', function() { var k = new Key(); should.exist(k); }); + it('should not fail when called as Key() without "new"', function() { + var key = Key(); + should.exist(key); + }); + it('should not fail when called as Key() without "new" with some args', function() { + var key = Key(1, 2, 3, 4, 5); + should.exist(key); + }); + it('should have correct properties when called with Key() without "new"', function() { + var key = Key(); + key.compressed.should.equal(true); + should.not.exist(key.public); + should.not.exist(key.private); + should.exist(key); + }); it('should be able to generateSync instance', function() { var k = Key.generateSync(); should.exist(k);