File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
packages/wrangler/e2e/unenv-preset/worker Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -881,15 +881,18 @@ export const WorkerdTests: Record<string, () => void> = {
881881 assert . strictEqual ( tty . isatty ( 1 ) , false ) ;
882882 assert . strictEqual ( tty . isatty ( 2 ) , false ) ;
883883
884- // Both implementations throw when calling ReadStream/WriteStream constructors
885- assert . throws (
886- ( ) => new ( tty . ReadStream as any ) ( 0 ) ,
887- / n o t i m p l e m e n t e d | E R R _ M E T H O D _ N O T _ I M P L E M E N T E D /
888- ) ;
889- assert . throws (
890- ( ) => new ( tty . WriteStream as any ) ( 1 ) ,
891- / n o t i m p l e m e n t e d | E R R _ M E T H O D _ N O T _ I M P L E M E N T E D /
892- ) ;
884+ // Native workerd throws when calling ReadStream/WriteStream constructors
885+ // unenv stub does not throw - it creates stub objects
886+ if ( getRuntimeFlagValue ( "enable_nodejs_tty_module" ) ) {
887+ assert . throws (
888+ ( ) => new ( tty . ReadStream as any ) ( 0 ) ,
889+ / E R R _ M E T H O D _ N O T _ I M P L E M E N T E D /
890+ ) ;
891+ assert . throws (
892+ ( ) => new ( tty . WriteStream as any ) ( 1 ) ,
893+ / E R R _ M E T H O D _ N O T _ I M P L E M E N T E D /
894+ ) ;
895+ }
893896 } ,
894897} ;
895898
You can’t perform that action at this time.
0 commit comments