feat: resolve server URLs before calling other listeners#19981
feat: resolve server URLs before calling other listeners#19981sapphi-red merged 4 commits intovitejs:mainfrom sirdiego:sync_server_start
Conversation
I think you can put it in test('check', () => {
expect.assertions(1)
const { promise, resolve } = promiseWithResolvers<void>()
const server = await createServer({
root: __dirname,
logLevel: 'error',
server: {
port: 9400, // make sure the port is unique
ws: false,
},
plugins: [/* add plugin that checks server.resolvedUrls here */]
})
await server.listen()
await promise
})It needs to wait for the |
Thanks for the suggestion. That worked out very good. I added a new suite to the dev.spec.ts that fails without this patch and is green with this patch. |
|
Has the Windows test fail anything to do with these changes? Is there something I can do here? |
|
It's probably a flaky fail. I've retriggered the CI 👍 |
Description
This PR moves the resolving of the URLs to before the server is started. This way one can use
configureServerto get those information from the server.I added a first test but am a little lost in how and where I could test the integrated functions. I'd love for this to get merged but would also appreciate help on how to write more tests here.
Thank you folks so much!