File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ export default function wrapper(context) {
205
205
byteLength = end - start + 1 ;
206
206
} else {
207
207
bufferOtStream = context . outputFileSystem . readFileSync ( filename ) ;
208
- byteLength = Buffer . byteLength ( bufferOtStream ) ;
208
+ ( { byteLength } = bufferOtStream ) ;
209
209
}
210
210
} catch ( _ignoreError ) {
211
211
await goNext ( ) ;
Original file line number Diff line number Diff line change @@ -99,6 +99,10 @@ describe.each([
99
99
path . resolve ( outputPath , "image.svg" ) ,
100
100
"svg image"
101
101
) ;
102
+ instance . context . outputFileSystem . writeFileSync (
103
+ path . resolve ( outputPath , "byte-length.html" ) ,
104
+ "\u00bd + \u00bc = \u00be"
105
+ ) ;
102
106
instance . context . outputFileSystem . mkdirSync (
103
107
path . resolve ( outputPath , "directory/nested-directory" ) ,
104
108
{ recursive : true }
@@ -376,6 +380,24 @@ describe.each([
376
380
. expect ( "Content-Length" , fileData . byteLength . toString ( ) )
377
381
. expect ( 200 , done ) ;
378
382
} ) ;
383
+
384
+ it ( 'should return "200" code code for the "GET" request and "Content-Length" to the file with unicode' , ( done ) => {
385
+ request ( app )
386
+ . get ( "/byte-length.html" )
387
+ . expect ( "Content-Type" , "text/html; charset=utf-8" )
388
+ . expect ( "Content-Length" , "12" )
389
+ . expect ( 200 , ( error ) => {
390
+ if ( error ) {
391
+ return done ( error ) ;
392
+ }
393
+
394
+ expect ( fs . existsSync ( path . resolve ( outputPath , "bundle.js" ) ) ) . toBe (
395
+ false
396
+ ) ;
397
+
398
+ return done ( ) ;
399
+ } ) ;
400
+ } ) ;
379
401
} ) ;
380
402
381
403
describe ( 'should not work with the broken "publicPath" option' , ( ) => {
You can’t perform that action at this time.
0 commit comments