Skip to content

Glossary: Real-Time Apps with WebSockets

waitFor()

Also written: waitFor, socket.once

A small test helper that turns "the next time this event arrives" into a Promise you can `await`. Start waiting before the action that causes the event.

Where the book teaches it

Related terms

buildApp()Port 0