@@ -333,15 +333,15 @@ export var test_request_headersSentAndReceivedProperly = function (done) {
333333 method : "GET" ,
334334 headers : { "Content-Type" : "application/json" }
335335 } ) . then ( function ( response ) {
336- result = response . headers ;
337- try {
338- TKUnit . assert ( result [ "Content-Type" ] === "application/json" , "Headers not sent/received properly!" ) ;
339- done ( null ) ;
340- }
341- catch ( err ) {
342- done ( err ) ;
343- }
344- } , function ( e ) {
336+ result = response . headers ;
337+ try {
338+ TKUnit . assert ( result [ "Content-Type" ] === "application/json" , "Headers not sent/received properly!" ) ;
339+ done ( null ) ;
340+ }
341+ catch ( err ) {
342+ done ( err ) ;
343+ }
344+ } , function ( e ) {
345345 done ( e ) ;
346346 } ) ;
347347} ;
@@ -355,15 +355,15 @@ export var test_request_contentSentAndReceivedProperly = function (done) {
355355 headers : { "Content-Type" : "application/x-www-form-urlencoded" } ,
356356 content : "MyVariableOne=ValueOne&MyVariableTwo=ValueTwo"
357357 } ) . then ( function ( response ) {
358- result = response . content . toJSON ( ) ;
359- try {
360- TKUnit . assert ( result [ "form" ] [ "MyVariableOne" ] === "ValueOne" && result [ "form" ] [ "MyVariableTwo" ] === "ValueTwo" , "Content not sent/received properly!" ) ;
361- done ( null ) ;
362- }
363- catch ( err ) {
364- done ( err ) ;
365- }
366- } , function ( e ) {
358+ result = response . content . toJSON ( ) ;
359+ try {
360+ TKUnit . assert ( result [ "form" ] [ "MyVariableOne" ] === "ValueOne" && result [ "form" ] [ "MyVariableTwo" ] === "ValueTwo" , "Content not sent/received properly!" ) ;
361+ done ( null ) ;
362+ }
363+ catch ( err ) {
364+ done ( err ) ;
365+ }
366+ } , function ( e ) {
367367 done ( e ) ;
368368 } ) ;
369369} ;
@@ -379,15 +379,15 @@ export var test_request_NonStringHeadersSentAndReceivedProperly = function (done
379379 headers : { "Content-Type" : "application/x-www-form-urlencoded" , "Content-Length" : postData . length } ,
380380 content : postData
381381 } ) . then ( function ( response ) {
382- result = response . content . toJSON ( ) ;
383- try {
384- TKUnit . assert ( result [ "form" ] [ "MyVariableOne" ] === "ValueOne" && result [ "form" ] [ "MyVariableTwo" ] === "ValueTwo" , "Content not sent/received properly!" ) ;
385- done ( null ) ;
386- }
387- catch ( err ) {
388- done ( err ) ;
389- }
390- } , function ( e ) {
382+ result = response . content . toJSON ( ) ;
383+ try {
384+ TKUnit . assert ( result [ "form" ] [ "MyVariableOne" ] === "ValueOne" && result [ "form" ] [ "MyVariableTwo" ] === "ValueTwo" , "Content not sent/received properly!" ) ;
385+ done ( null ) ;
386+ }
387+ catch ( err ) {
388+ done ( err ) ;
389+ }
390+ } , function ( e ) {
391391 done ( e ) ;
392392 } ) ;
393393} ;
@@ -404,24 +404,23 @@ export var test_request_jsonAsContentSentAndReceivedProperly = function (done) {
404404 headers : { "Content-Type" : "application/json" } ,
405405 content : JSON . stringify ( { MyVariableOne : "ValueOne" , MyVariableTwo : "ValueTwo" } )
406406 } ) . then ( function ( response ) {
407- // result = response.content.toJSON();
408- // <hide>
409- result = response . content . toJSON ( ) ;
410- try
411- {
412- TKUnit . assert ( result [ "json" ] [ "MyVariableOne" ] === "ValueOne" && result [ "json" ] [ "MyVariableTwo" ] === "ValueTwo" , "Content not sent/received properly!" ) ;
413- done ( null ) ;
414- }
415- catch ( err ) {
416- done ( err ) ;
417- }
407+ // result = response.content.toJSON();
408+ // <hide>
409+ result = response . content . toJSON ( ) ;
410+ try {
411+ TKUnit . assert ( result [ "json" ] [ "MyVariableOne" ] === "ValueOne" && result [ "json" ] [ "MyVariableTwo" ] === "ValueTwo" , "Content not sent/received properly!" ) ;
412+ done ( null ) ;
413+ }
414+ catch ( err ) {
415+ done ( err ) ;
416+ }
418417 // </hide>
419418 // console.log(result);
420- } , function ( e ) {
421- // <hide>
419+ } , function ( e ) {
420+ // <hide>
422421 done ( e ) ;
423- // </hide>
424- // console.log("Error occurred " + e);
422+ // </hide>
423+ // console.log("Error occurred " + e);
425424 } ) ;
426425 // ```
427426 // </snippet>
@@ -452,4 +451,4 @@ function doRequest(url: string, done: Function) {
452451 } , function ( e ) {
453452 done ( e ) ;
454453 } ) ;
455- }
454+ } ;
0 commit comments