Skip to content

Commit

Permalink
fix: vite startDevServer needs to return close() (#16950)
Browse files Browse the repository at this point in the history
Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
  • Loading branch information
Barthélémy Ledoux and lmiller1990 authored Jun 18, 2021
1 parent da6f8cf commit 67b2b3b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions npm/vite-dev-server/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { debug as debugFn } from 'debug'
import { Server } from 'http'
import { start as createDevServer, StartDevServer } from './startServer'
const debug = debugFn('cypress:vite-dev-server:vite')

export { StartDevServer }

type DoneCallback = () => unknown

export interface ResolvedDevServerConfig {
port: number
server: Server
close: (done?: DoneCallback) => void
}

export async function startDevServer (startDevServerArgs: StartDevServer): Promise<ResolvedDevServerConfig> {
Expand All @@ -18,5 +19,5 @@ export async function startDevServer (startDevServerArgs: StartDevServer): Promi

debug('Component testing vite server started on port', port)

return { port, server: app.httpServer }
return { port, close: app.httpServer.close }
}

0 comments on commit 67b2b3b

Please sign in to comment.