22const chai = require ( 'chai' ) ;
33const sinon = require ( 'sinon' ) ;
44const sinonTest = require ( 'sinon-test' ) ;
5+ var test = sinonTest ( sinon ) ;
56const expect = require ( 'chai' ) . expect ;
67let request = require ( 'request' ) ;
78
@@ -16,7 +17,7 @@ let bcapi = new BlockCypher(chain, network, token);
1617
1718describe ( 'Blockcypher _post Method: ' , function ( ) {
1819
19- it ( 'should return success statusCode 200 and return data' , sinon . test ( function ( done ) {
20+ it ( 'should return success statusCode 200 and return data' , test ( function ( done ) {
2021 let post = this . spy ( bcapi . _post ) . bind ( bcapi ) ;
2122 let validReturn = { data : { key1 : 'value' , key2 : 2 } } ;
2223 let inputBody = { data : { } } ;
@@ -37,7 +38,7 @@ describe('Blockcypher _post Method: ', function () {
3738 } ) ;
3839 } ) ) ;
3940
40- it ( 'should return success statusCode 201 and return data' , sinon . test ( function ( done ) {
41+ it ( 'should return success statusCode 201 and return data' , test ( function ( done ) {
4142 let post = this . spy ( bcapi . _post ) . bind ( bcapi ) ;
4243 let validReturn = { data : { key1 : 'value' , key2 : 2 } } ;
4344 let inputBody = { data : { } } ;
@@ -59,7 +60,7 @@ describe('Blockcypher _post Method: ', function () {
5960 } ) ) ;
6061
6162
62- it ( 'should return error and empty data when response body is null' , sinon . test ( function ( done ) {
63+ it ( 'should return error and empty data when response body is null' , test ( function ( done ) {
6364 let post = this . spy ( bcapi . _post ) . bind ( bcapi ) ;
6465 let badRequestError = "Bad Request" ;
6566 let inputBody = { data : { } } ;
@@ -80,7 +81,7 @@ describe('Blockcypher _post Method: ', function () {
8081 } ) ;
8182 } ) ) ;
8283
83- it ( 'should return error and data when response body exists' , sinon . test ( function ( done ) {
84+ it ( 'should return error and data when response body exists' , test ( function ( done ) {
8485 let post = this . spy ( bcapi . _post ) . bind ( bcapi ) ;
8586 let badRequestError = "Bad Request" ;
8687 let badRequestData = { message : 'badRequeset' } ;
0 commit comments