File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ export interface IProcess {
66 cwd ( ) : string ;
77 platform : string ;
88 nextTick : ( callback : ( ...args ) => void , ...args ) => void ;
9+ emitWarning : ( message : string , type : string ) => void ;
910 env : {
1011 MEMFS_DONT_WARN ?: boolean ;
1112 } ;
@@ -23,6 +24,11 @@ export function createProcess(p: IProcess = process): IProcess {
2324 if ( ! p . getgid ) p . getgid = ( ) => 0 ;
2425 if ( ! p . cwd ) p . cwd = ( ) => '/' ;
2526 if ( ! p . nextTick ) p . nextTick = require ( './setImmediate' ) . default ;
27+ if ( ! p . emitWarning )
28+ p . emitWarning = ( message , type ) => {
29+ // tslint:disable-next-line:no-console
30+ console . warn ( `${ type } ${ type ? ': ' : '' } ${ message } ` ) ;
31+ } ;
2632 if ( ! p . env ) p . env = { } ;
2733 return p ;
2834}
Original file line number Diff line number Diff line change @@ -582,7 +582,7 @@ export class Volume {
582582 get promises ( ) {
583583 if ( promisesWarn ) {
584584 promisesWarn = false ;
585- require ( ' process' ) . emitWarning ( 'The fs.promises API is experimental' , 'ExperimentalWarning' ) ;
585+ process . emitWarning ( 'The fs.promises API is experimental' , 'ExperimentalWarning' ) ;
586586 }
587587 if ( this . promisesApi === null ) throw new Error ( 'Promise is not supported in this environment.' ) ;
588588 return this . promisesApi ;
You can’t perform that action at this time.
0 commit comments