File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -20,18 +20,18 @@ describe('FormatStream', function() {
2020
2121 it ( 'should format objects' , function ( done ) {
2222 var stream = new FormatStream ( { objectMode : true } ) ;
23- stream . setEncoding ( 'utf8' ) ;
23+ // stream.setEncoding('utf8');
2424 var source = {
2525 results : [
2626 {
2727 alternatives : [
2828 {
2929 confidence : 0.881 ,
30- transcript : 'foo bar ' ,
31- final : true
30+ transcript : 'foo bar '
3231 }
3332 ] ,
34- result_index : 0
33+ result_index : 0 ,
34+ final : true
3535 }
3636 ]
3737 } ;
@@ -41,16 +41,18 @@ describe('FormatStream', function() {
4141 alternatives : [
4242 {
4343 confidence : 0.881 ,
44- transcript : 'Foo bar. ' ,
45- final : true
44+ transcript : 'Foo bar. '
4645 }
4746 ] ,
48- result_index : 0
47+ result_index : 0 ,
48+ final : true
4949 }
5050 ]
5151 } ;
5252 stream . on ( 'data' , function ( actual ) {
53- assert . equal ( actual , expected ) ;
53+ console . log ( JSON . stringify ( actual , null , 2 ) )
54+ console . log ( JSON . stringify ( expected , null , 2 ) )
55+ assert . deepEqual ( actual , expected ) ;
5456 done ( ) ;
5557 } ) ;
5658 stream . on ( 'error' , done ) ;
You can’t perform that action at this time.
0 commit comments