@@ -95,9 +95,10 @@ describe("Brotli-wasm", () => {
95
95
expect ( stream . result ( ) ) . to . equal ( brotli . BrotliStreamResult . NeedsMoreInput ) ;
96
96
const output3 = stream . compress ( undefined , 100 ) ;
97
97
expect ( stream . result ( ) ) . to . equal ( brotli . BrotliStreamResult . ResultSuccess ) ;
98
- // It will be CwOAVGVzdCBpbjgACHB1dCBkYXRhAw== which is different .
98
+ // It will be different from non-streaming result .
99
99
// But it can still be decompressed back to the original string.
100
- // expect(Buffer.concat([output1, output2, output3]).toString('base64')).to.equal('CweAVGVzdCBpbnB1dCBkYXRhAw==');
100
+ let output = Buffer . concat ( [ output1 , output2 , output3 ] ) ;
101
+ expect ( Buffer . from ( brotli . decompress ( output ) ) . toString ( 'base64' ) ) . to . equal ( input . toString ( 'base64' ) ) ;
101
102
} ) ;
102
103
103
104
it ( "can streamingly decompress data" , ( ) => {
@@ -137,7 +138,7 @@ describe("Brotli-wasm", () => {
137
138
expect ( stream . result ( ) ) . to . lt ( 0 ) ;
138
139
} ) ;
139
140
140
- it ( "can compress & decompress back to the original result" , ( ) => {
141
+ it ( "can streamingly compress & decompress back to the original result" , ( ) => {
141
142
const s = "Some thrilling text I urgently need to compress" ;
142
143
const encInput = Buffer . from ( s ) ;
143
144
const encInput1 = encInput . slice ( 0 , encInput . length / 2 ) ;
@@ -163,7 +164,7 @@ describe("Brotli-wasm", () => {
163
164
expect ( decOutput . toString ( 'utf8' ) ) . to . equal ( s ) ;
164
165
} ) ;
165
166
166
- it ( "can compress & decompress back to the original result with a different quality setting" , ( ) => {
167
+ it ( "can streamingly compress & decompress back to the original result with a different quality setting" , ( ) => {
167
168
const s = "Some thrilling text I urgently need to compress" ;
168
169
const encInput = Buffer . from ( s ) ;
169
170
const encInput1 = encInput . slice ( 0 , encInput . length / 2 ) ;
0 commit comments