44var assert = require ( 'assert' )
55var ecdsa = require ( '../src/ecdsa' )
66var sinon = require ( 'sinon' )
7+ var sinonTest = require ( 'sinon-test' )
8+ var setupTest = sinonTest ( sinon )
79
810var BigInteger = require ( 'bigi' )
911var ECPair = require ( '../src/ecpair' )
@@ -79,7 +81,7 @@ describe('HDNode', function () {
7981 } )
8082 } )
8183
82- it ( 'throws if IL is not within interval [1, n - 1] | IL === 0' , sinon . test ( function ( ) {
84+ it ( 'throws if IL is not within interval [1, n - 1] | IL === 0' , setupTest ( function ( ) {
8385 this . mock ( BigInteger ) . expects ( 'fromBuffer' )
8486 . once ( ) . returns ( BigInteger . ZERO )
8587
@@ -88,7 +90,7 @@ describe('HDNode', function () {
8890 } , / P r i v a t e k e y m u s t b e g r e a t e r t h a n 0 / )
8991 } ) )
9092
91- it ( 'throws if IL is not within interval [1, n - 1] | IL === n' , sinon . test ( function ( ) {
93+ it ( 'throws if IL is not within interval [1, n - 1] | IL === n' , setupTest ( function ( ) {
9294 this . mock ( BigInteger ) . expects ( 'fromBuffer' )
9395 . once ( ) . returns ( curve . n )
9496
@@ -122,7 +124,7 @@ describe('HDNode', function () {
122124 } )
123125
124126 describe ( 'getAddress' , function ( ) {
125- it ( 'wraps keyPair.getAddress' , sinon . test ( function ( ) {
127+ it ( 'wraps keyPair.getAddress' , setupTest ( function ( ) {
126128 this . mock ( keyPair ) . expects ( 'getAddress' )
127129 . once ( ) . withArgs ( ) . returns ( 'foobar' )
128130
@@ -131,7 +133,7 @@ describe('HDNode', function () {
131133 } )
132134
133135 describe ( 'getNetwork' , function ( ) {
134- it ( 'wraps keyPair.getNetwork' , sinon . test ( function ( ) {
136+ it ( 'wraps keyPair.getNetwork' , setupTest ( function ( ) {
135137 this . mock ( keyPair ) . expects ( 'getNetwork' )
136138 . once ( ) . withArgs ( ) . returns ( 'network' )
137139
@@ -140,7 +142,7 @@ describe('HDNode', function () {
140142 } )
141143
142144 describe ( 'getPublicKeyBuffer' , function ( ) {
143- it ( 'wraps keyPair.getPublicKeyBuffer' , sinon . test ( function ( ) {
145+ it ( 'wraps keyPair.getPublicKeyBuffer' , setupTest ( function ( ) {
144146 this . mock ( keyPair ) . expects ( 'getPublicKeyBuffer' )
145147 . once ( ) . withArgs ( ) . returns ( 'pubKeyBuffer' )
146148
@@ -149,7 +151,7 @@ describe('HDNode', function () {
149151 } )
150152
151153 describe ( 'sign' , function ( ) {
152- it ( 'wraps keyPair.sign' , sinon . test ( function ( ) {
154+ it ( 'wraps keyPair.sign' , setupTest ( function ( ) {
153155 this . mock ( keyPair ) . expects ( 'sign' )
154156 . once ( ) . withArgs ( hash ) . returns ( 'signed' )
155157
@@ -164,7 +166,7 @@ describe('HDNode', function () {
164166 signature = hd . sign ( hash )
165167 } )
166168
167- it ( 'wraps keyPair.verify' , sinon . test ( function ( ) {
169+ it ( 'wraps keyPair.verify' , setupTest ( function ( ) {
168170 this . mock ( keyPair ) . expects ( 'verify' )
169171 . once ( ) . withArgs ( hash , signature ) . returns ( 'verified' )
170172
0 commit comments