thefrontside / simulacrum

A simulation platform for use during testing, during development and for high-fidelity application previews
85 stars 14 forks source link

Don't report server started until listener callback is invoked #268

Closed cowboyd closed 10 months ago

cowboyd commented 10 months ago

Motivation

The server resource was being reported as initialized before the server.listen() callback was invoked. This meant that you could have test code that relied on the server running, and awaited server initialization, but the server was not actually up and accepting connections.

Approach

During server initialization, create a promise that is only ever resolved when the server.listen() callback is invoked.

netlify[bot] commented 10 months ago

Deploy Preview for simulacrum canceled.

Name Link
Latest commit b7351c932126014e0583ae792dea3c4da6e83536
Latest deploy log https://app.netlify.com/sites/simulacrum/deploys/64fa00f62073b60008fd31d8