File tree Expand file tree Collapse file tree 2 files changed +30
-15
lines changed
unenv-preset/src/runtime/node
wrangler/e2e/unenv-preset/worker Expand file tree Collapse file tree 2 files changed +30
-15
lines changed Original file line number Diff line number Diff line change @@ -73,32 +73,18 @@ export const {
73
73
_startProfilerIdleNotifier,
74
74
_stopProfilerIdleNotifier,
75
75
_tickCallback,
76
- addListener,
77
76
assert,
78
77
availableMemory,
79
78
constrainedMemory,
80
79
cpuUsage,
81
80
disconnect,
82
81
domain,
83
82
emit, // not exported from workerd but used internally
84
- eventNames,
85
83
execPath,
86
- getMaxListeners,
87
- listenerCount,
88
- listeners,
89
84
mainModule,
90
85
moduleLoadList,
91
- off,
92
- on,
93
- once,
94
86
openStdin,
95
- prependListener,
96
- prependOnceListener,
97
- rawListeners,
98
87
reallyExit,
99
- removeListener,
100
- setMaxListeners,
101
- removeAllListeners,
102
88
} = unenvProcess ;
103
89
104
90
// APIs that are not implemented in `workerd` v1 and `undefined` in v2.
@@ -128,9 +114,10 @@ export const {
128
114
unref,
129
115
} = unenvProcess ;
130
116
131
- // API that are only implemented starting from v2 or workerd process
117
+ // API that are only implemented starting from v2 of workerd process
132
118
export const {
133
119
abort,
120
+ addListener,
134
121
allowedNodeEnvironmentFlags,
135
122
arch,
136
123
argv,
@@ -139,21 +126,34 @@ export const {
139
126
config,
140
127
cwd,
141
128
emitWarning,
129
+ eventNames,
142
130
execArgv,
143
131
getegid,
144
132
geteuid,
145
133
getgid,
146
134
getgroups,
135
+ getMaxListeners,
147
136
getuid,
148
137
// @ts -expect-error `initgroups` is missing typings
149
138
initgroups,
139
+ listenerCount,
140
+ listeners,
150
141
loadEnvFile,
142
+ off,
143
+ on,
144
+ once,
151
145
pid,
152
146
ppid,
147
+ prependListener,
148
+ prependOnceListener,
149
+ rawListeners,
150
+ removeAllListeners,
151
+ removeListener,
153
152
setegid,
154
153
seteuid,
155
154
setgid,
156
155
setgroups,
156
+ setMaxListeners,
157
157
setSourceMapsEnabled,
158
158
setuid,
159
159
stderr,
Original file line number Diff line number Diff line change @@ -525,6 +525,21 @@ export const WorkerdTests: Record<string, () => void> = {
525
525
526
526
assert . doesNotThrow ( ( ) => p . chdir ( "/tmp" ) ) ;
527
527
assert . equal ( typeof p . cwd ( ) , "string" ) ;
528
+
529
+ assert . equal ( typeof p . addListener , "function" ) ;
530
+ assert . equal ( typeof p . eventNames , "function" ) ;
531
+ assert . equal ( typeof p . getMaxListeners , "function" ) ;
532
+ assert . equal ( typeof p . listenerCount , "function" ) ;
533
+ assert . equal ( typeof p . listeners , "function" ) ;
534
+ assert . equal ( typeof p . off , "function" ) ;
535
+ assert . equal ( typeof p . on , "function" ) ;
536
+ assert . equal ( typeof p . once , "function" ) ;
537
+ assert . equal ( typeof p . prependListener , "function" ) ;
538
+ assert . equal ( typeof p . prependOnceListener , "function" ) ;
539
+ assert . equal ( typeof p . rawListeners , "function" ) ;
540
+ assert . equal ( typeof p . removeAllListeners , "function" ) ;
541
+ assert . equal ( typeof p . removeListener , "function" ) ;
542
+ assert . equal ( typeof p . setMaxListeners , "function" ) ;
528
543
}
529
544
} ,
530
545
} ;
You can’t perform that action at this time.
0 commit comments