MCPcopy Create free account
hub / github.com/Snapchat/Valdi / waitForPromise

Function waitForPromise

valdi/test/utils/TestAsyncUtils.cpp:13–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11namespace ValdiTest {
12
13Result<Value> waitForPromise(const Ref<Promise>& promise) {
14 auto resultHolder = ResultHolder<Value>::make();
15
16 promise->onComplete([completion = resultHolder->makeCompletion()](const auto& result) { completion(result); });
17
18 return resultHolder->waitForResult();
19}
20
21} // namespace ValdiTest

Callers 1

TEST_PMethod · 0.85

Calls 3

makeCompletionMethod · 0.80
waitForResultMethod · 0.80
onCompleteMethod · 0.65

Tested by

no test coverage detected