File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 11import fs from 'node:fs' ;
22import path from 'node:path' ;
3+ import { fileURLToPath } from 'node:url' ;
34import { strict as assert } from 'node:assert' ;
45import { mm , MockApplication } from '@eggjs/mock' ;
56import { Context } from '@eggjs/core' ;
67
8+ const __filename = fileURLToPath ( import . meta. url ) ;
9+ const __dirname = path . dirname ( __filename ) ;
10+
711describe ( 'test/onerror.test.ts' , ( ) => {
812 let app : MockApplication ;
913 before ( ( ) => {
@@ -292,7 +296,7 @@ describe('test/onerror.test.ts', () => {
292296 await app . httpRequest ( )
293297 . post ( '/body_parser' )
294298 . set ( 'Content-Type' , 'application/x-www-form-urlencoded' )
295- . send ( { foo : new Buffer ( 1024 * 1000 ) . fill ( 1 ) . toString ( ) } )
299+ . send ( { foo : Buffer . alloc ( 1024 * 1000 ) . fill ( 1 ) . toString ( ) } )
296300 . expect ( / r e q u e s t e n t i t y t o o l a r g e / )
297301 . expect ( 413 ) ;
298302 await app . close ( ) ;
You can’t perform that action at this time.
0 commit comments