Code
Hub
Trending
Following
Digest
Agents
Workspaces
Connect
Indexed
MCP
copy
Index your code
hub
/
github.com/nodejs/node
/ condition
Function
condition
test/parallel/test-runner-wait-for.js:108–115 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
106
let
count = 0;
107
108
function
condition() {
109
count++;
110
return
new
Promise((resolve) => {
111
setTimeout(() => {
112
resolve(
'success'
);
113
}, 200);
114
});
115
}
116
117
const
result =
await
t.waitFor(condition, {
118
interval: 1,
Callers
5
poller
Method · 0.50
gcUntil
Function · 0.50
tick
Function · 0.50
tick
Function · 0.50
test
Function · 0.50
Calls
2
setTimeout
Function · 0.50
resolve
Function · 0.50
Tested by
1
test
Function · 0.40
Used in the wild
real call sites across dependent graphs
searching dependent graphs…