File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 11"use strict" ;
22
33const utils = require ( "../lib/utils" ) ;
4+ const { Readable } = require ( 'stream' ) ;
45
56/******************************************************************************/
67/*** BEGIN TESTS ***/
@@ -489,5 +490,15 @@ describe("Utility Function Tests:", function () {
489490
490491 } ) ; // end deepMerge tests
491492
492-
493+ describe ( "streamToBuffer:" , function ( ) {
494+ it ( "Should transform a given stream to a buffer" , function ( ) {
495+ let stream = new Readable ( ) ;
496+ stream . push ( "test" ) ;
497+ stream . push ( null ) ;
498+ return utils . streamToBuffer ( stream ) . then ( ( buffer ) => {
499+ expect ( Buffer . isBuffer ( buffer ) ) . toBe ( true ) ;
500+ expect ( buffer . toString ( ) ) . toBe ( "test" ) ;
501+ } ) ;
502+ } )
503+ } )
493504} ) ; // end UTILITY tests
You can’t perform that action at this time.
0 commit comments