Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
levivilet committed Dec 27, 2024
1 parent 2452648 commit db00c65
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@jest/globals'
import getPort from 'get-port'
import { createPreviewProcess } from '../src/parts/CreatePreviewProcess/CreatePreviewProcess.js'

test.skip('preview process - handles port already in use', async () => {
test('preview process - handles port already in use', async () => {
const previewProcess1 = createPreviewProcess()
const previewProcess2 = createPreviewProcess()
const id1 = 1
Expand All @@ -13,9 +13,8 @@ test.skip('preview process - handles port already in use', async () => {
await previewProcess1.invoke('WebViewServer.start', id1, port)

await previewProcess2.invoke('WebViewServer.create', id2)
// TODO improve error message
await expect(previewProcess2.invoke('WebViewServer.start', id2, port)).rejects.toThrow(
"Failed to start webview server: TypeError: Cannot read properties of undefined (reading 'server')",
`Failed to start webview server: Server error: Error: listen EADDRINUSE: address already in use :::${port}`,
)

previewProcess1[Symbol.dispose]()
Expand Down

0 comments on commit db00c65

Please sign in to comment.