|
|
@ -91,25 +91,25 @@ describe('HDPrivate key interface', function() { |
|
|
|
it('fromJSON checks that a valid JSON is provided', function() { |
|
|
|
var errorMessage = 'No valid JSON string was provided'; |
|
|
|
var method = 'fromJSON'; |
|
|
|
expectStaticMethodFail(method, undefined, errorMessage); |
|
|
|
expectStaticMethodFail(method, null, errorMessage); |
|
|
|
expectStaticMethodFail(method, 'invalid JSON', errorMessage); |
|
|
|
expectStaticMethodFail(method, '{\'singlequotes\': true}', errorMessage); |
|
|
|
expectStaticMethodFail(method, {}, errorMessage); |
|
|
|
expectStaticMethodFail(method, undefined, errorMessage); |
|
|
|
expectStaticMethodFail(method, null, errorMessage); |
|
|
|
expectStaticMethodFail(method, 'invalid JSON', errorMessage); |
|
|
|
expectStaticMethodFail(method, '{\'singlequotes\': true}', errorMessage); |
|
|
|
expectStaticMethodFail(method, {}, errorMessage); |
|
|
|
}); |
|
|
|
it('fromString checks that a string is provided', function() { |
|
|
|
var errorMessage = 'No valid string was provided'; |
|
|
|
var method = 'fromString'; |
|
|
|
expectStaticMethodFail(method, undefined, errorMessage); |
|
|
|
expectStaticMethodFail(method, null, errorMessage); |
|
|
|
expectStaticMethodFail(method, {}, errorMessage); |
|
|
|
expectStaticMethodFail(method, undefined, errorMessage); |
|
|
|
expectStaticMethodFail(method, null, errorMessage); |
|
|
|
expectStaticMethodFail(method, {}, errorMessage); |
|
|
|
}); |
|
|
|
it('fromObject checks that an object is provided', function() { |
|
|
|
var errorMessage = 'No valid argument was provided'; |
|
|
|
var method = 'fromObject'; |
|
|
|
expectStaticMethodFail(method, undefined, errorMessage); |
|
|
|
expectStaticMethodFail(method, null, errorMessage); |
|
|
|
expectStaticMethodFail(method, '', errorMessage); |
|
|
|
expectStaticMethodFail(method, undefined, errorMessage); |
|
|
|
expectStaticMethodFail(method, null, errorMessage); |
|
|
|
expectStaticMethodFail(method, '', errorMessage); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|