From 01f0d64ad988c9f4d9efef6fc2681831d8c6acab Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 26 Sep 2025 17:16:10 +0300 Subject: [PATCH 01/19] test: test dev server with/without sockets --- .gitignore | 6 +- packages/nuxt-cli/test/e2e/runtimes.spec.ts | 357 ++++++++++---------- 2 files changed, 188 insertions(+), 175 deletions(-) diff --git a/.gitignore b/.gitignore index f0502f0ab..857ada14a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,6 @@ nuxt-app .pnpm-store coverage stats.json -playground-bun -playground-deno -playground-node +playground-bun-* +playground-deno-* +playground-node-* diff --git a/packages/nuxt-cli/test/e2e/runtimes.spec.ts b/packages/nuxt-cli/test/e2e/runtimes.spec.ts index abafbdb1c..91669f349 100644 --- a/packages/nuxt-cli/test/e2e/runtimes.spec.ts +++ b/packages/nuxt-cli/test/e2e/runtimes.spec.ts @@ -95,186 +95,155 @@ function createIt(status: SupportStatus) { return it } -describe.sequential.each(runtimes)('dev server (%s)', (runtimeName) => { - let server: DevServerInstance - - if (!isCI && !runtime[runtimeName]) { - console.warn(`Not testing locally with ${runtimeName} as it is not installed.`) - _it.skip(`should pass with ${runtimeName}`) - return - } +const socketConfigs = [ + { enabled: true, label: 'with sockets' }, + { enabled: false, label: 'without sockets' }, +] as const - const cwd = resolve(playgroundDir, `../playground-${runtimeName}`) +describe.sequential.each(runtimes)('dev server (%s)', (runtimeName) => { + describe.sequential.each(socketConfigs)('$label', ({ enabled: socketsEnabled }) => { + let server: DevServerInstance - afterAll(async () => { - await server?.close() - await rm(cwd, { recursive: true, force: true }).catch(() => null) - }) + if (!isCI && !runtime[runtimeName]) { + console.warn(`Not testing locally with ${runtimeName} as it is not installed.`) + _it.skip(`should pass with ${runtimeName}`) + return + } - const it = createIt(supports[runtimeName]) + const cwd = resolve(playgroundDir, `../playground-${runtimeName}-${socketsEnabled ? 'sockets' : 'nosockets'}`) - it('should start dev server', { timeout: isCI ? 60_000 : 30_000 }, async () => { - rmSync(cwd, { recursive: true, force: true }) - cpSync(playgroundDir, cwd, { - recursive: true, - filter: src => !src.includes('.nuxt') && !src.includes('.output'), + afterAll(async () => { + await server?.close() + await rm(cwd, { recursive: true, force: true }).catch(() => null) }) - server = await startDevServer({ cwd, runtime: runtimeName }) - }) - - it('should serve the main page', async () => { - const response = await fetch(server.url) - expect(response.status).toBe(200) - const html = await response.text() - expect(html).toContain('Welcome to the Nuxt CLI playground') - expect(html).toContain('') - }) + const it = createIt(supports[runtimeName]) - it('should serve static assets', async () => { - const response = await fetch(`${server.url}/favicon.ico`) - expect(response.status).toBe(200) - expect(response.headers.get('content-type')).toContain('image/') - }) + it('should start dev server', { timeout: isCI ? 60_000 : 30_000 }, async () => { + rmSync(cwd, { recursive: true, force: true }) + cpSync(playgroundDir, cwd, { + recursive: true, + filter: src => !src.includes('.nuxt') && !src.includes('.output'), + }) + server = await startDevServer({ + cwd, + runtime: runtimeName, + socketsEnabled, + }) + }) - it('should handle API routes', async () => { - const response = await fetch(`${server.url}/api/hello`) - expect(response.status).toBe(200) - }) + it('should serve the main page', async () => { + const response = await fetch(server.url) + expect(response.status).toBe(200) - it('should handle POST requests', async () => { - const response = await fetch(`${server.url}/api/echo`, { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ test: 'data' }), + const html = await response.text() + expect(html).toContain('Welcome to the Nuxt CLI playground') + expect(html).toContain('') }) - expect(response.status).toBe(200) - }) + it('should serve static assets', async () => { + const response = await fetch(`${server.url}/favicon.ico`) + expect(response.status).toBe(200) + expect(response.headers.get('content-type')).toContain('image/') + }) - it('should preserve request headers', async () => { - const headers = { - 'X-Custom-Header': 'test-value', - 'User-Agent': 'vitest', - } + it('should handle API routes', async () => { + const response = await fetch(`${server.url}/api/hello`) + expect(response.status).toBe(200) + }) - const res = await fetch(`${server.url}/api/echo`, { headers }) - const { headers: receivedHeaders } = await res.json() + it('should handle POST requests', async () => { + const response = await fetch(`${server.url}/api/echo`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ test: 'data' }), + }) - expect(receivedHeaders).toMatchObject({ - 'user-agent': 'vitest', - 'x-custom-header': 'test-value', + expect(response.status).toBe(200) }) - expect(res.status).toBe(200) - }) + it('should preserve request headers', async () => { + const headers = { + 'X-Custom-Header': 'test-value', + 'User-Agent': 'vitest', + } - it('should handle concurrent requests', async () => { - const requests = Array.from({ length: 5 }, () => fetch(server.url)) - const responses = await Promise.all(requests) + const res = await fetch(`${server.url}/api/echo`, { headers }) + const { headers: receivedHeaders } = await res.json() - for (const response of responses) { - expect(response.status).toBe(200) - expect(await response.text()).toContain('Welcome to the Nuxt CLI playground') - } - }) + expect(receivedHeaders).toMatchObject({ + 'user-agent': 'vitest', + 'x-custom-header': 'test-value', + }) - it('should handle large request payloads', async () => { - const largePayload = { data: 'x'.repeat(10_000) } - const response = await fetch(`${server.url}/api/echo`, { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify(largePayload), + expect(res.status).toBe(200) }) - expect(response.status).toBe(200) - const result = await response.json() - expect(result.echoed.data).toBe(largePayload.data) - }) + it('should handle concurrent requests', async () => { + const requests = Array.from({ length: 5 }, () => fetch(server.url)) + const responses = await Promise.all(requests) - it('should handle different HTTP methods', async () => { - const methods = ['GET', 'POST', 'PUT', 'DELETE'] + for (const response of responses) { + expect(response.status).toBe(200) + expect(await response.text()).toContain('Welcome to the Nuxt CLI playground') + } + }) - for (const method of methods) { - const response = await fetch(`${server.url}/api/hello`, { method }) - expect(response.status).toBe(200) + it('should handle large request payloads', async () => { + const largePayload = { data: 'x'.repeat(10_000) } + const response = await fetch(`${server.url}/api/echo`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(largePayload), + }) + expect(response.status).toBe(200) const result = await response.json() - expect(result.method).toBe(method) - } - }) + expect(result.echoed.data).toBe(largePayload.data) + }) - it('should establish websocket connection and handle ping/pong', { timeout: 20_000 }, async () => { - const wsUrl = `${server.url.replace('http', 'ws')}/_ws` - - // Create a promise that resolves when the websocket test is complete - const wsTest = new Promise((resolve, reject) => { - const ws = new WebSocket(wsUrl) - - let isConnected = false - let receivedPong = false - - const timeout = setTimeout(() => { - if (!isConnected) { - reject(new Error('WebSocket connection timeout')) - } - else if (!receivedPong) { - reject(new Error('Did not receive pong response')) - } - ws.close() - }, 20_000) - - ws.addEventListener('open', () => { - isConnected = true - // Send ping message to test echo functionality - ws.send('ping test message') - }) + it('should handle different HTTP methods', async () => { + const methods = ['GET', 'POST', 'PUT', 'DELETE'] - ws.addEventListener('message', (event) => { - const message = event.data.toString() - if (message === 'pong') { - receivedPong = true - clearTimeout(timeout) - ws.close() - resolve() - } - }) + for (const method of methods) { + const response = await fetch(`${server.url}/api/hello`, { method }) + expect(response.status).toBe(200) - ws.addEventListener('error', (error) => { - clearTimeout(timeout) - reject(new Error(`WebSocket error: ${error}`)) - }) - - ws.addEventListener('close', () => { - if (isConnected && receivedPong) { - resolve() - } - }) + const result = await response.json() + expect(result.method).toBe(method) + } }) - await wsTest - }) - - it('should handle multiple concurrent websocket connections', { timeout: 20_000 }, async () => { - const wsUrl = `${server.url.replace('http', 'ws')}/_ws` - const connectionCount = 3 + it('should establish websocket connection and handle ping/pong', { timeout: 20_000 }, async () => { + const wsUrl = `${server.url.replace('http', 'ws')}/_ws` - const connectionPromises = Array.from({ length: connectionCount }, (_, index) => { - return new Promise((resolve, reject) => { + // Create a promise that resolves when the websocket test is complete + const wsTest = new Promise((resolve, reject) => { const ws = new WebSocket(wsUrl) + let isConnected = false + let receivedPong = false + const timeout = setTimeout(() => { - reject(new Error(`WebSocket ${index} connection timeout`)) + if (!isConnected) { + reject(new Error('WebSocket connection timeout')) + } + else if (!receivedPong) { + reject(new Error('Did not receive pong response')) + } ws.close() - }, 5000) + }, 20_000) ws.addEventListener('open', () => { - ws.send(`ping from connection ${index}`) + isConnected = true + // Send ping message to test echo functionality + ws.send('ping test message') }) ws.addEventListener('message', (event) => { const message = event.data.toString() if (message === 'pong') { + receivedPong = true clearTimeout(timeout) ws.close() resolve() @@ -283,52 +252,94 @@ describe.sequential.each(runtimes)('dev server (%s)', (runtimeName) => { ws.addEventListener('error', (error) => { clearTimeout(timeout) - reject(new Error(`WebSocket ${index} error: ${error}`)) + reject(new Error(`WebSocket error: ${error}`)) + }) + + ws.addEventListener('close', () => { + if (isConnected && receivedPong) { + resolve() + } }) }) + + await wsTest }) - await Promise.all(connectionPromises) - }) + it('should handle multiple concurrent websocket connections', { timeout: 20_000 }, async () => { + const wsUrl = `${server.url.replace('http', 'ws')}/_ws` + const connectionCount = 3 - it('should handle websocket connection close gracefully', { timeout: 10_000 }, async () => { - const wsUrl = `${server.url.replace('http', 'ws')}/_ws` + const connectionPromises = Array.from({ length: connectionCount }, (_, index) => { + return new Promise((resolve, reject) => { + const ws = new WebSocket(wsUrl) - const wsTest = new Promise((resolve, reject) => { - const ws = new WebSocket(wsUrl) + const timeout = setTimeout(() => { + reject(new Error(`WebSocket ${index} connection timeout`)) + ws.close() + }, 5000) + + ws.addEventListener('open', () => { + ws.send(`ping from connection ${index}`) + }) + + ws.addEventListener('message', (event) => { + const message = event.data.toString() + if (message === 'pong') { + clearTimeout(timeout) + ws.close() + resolve() + } + }) + + ws.addEventListener('error', (error) => { + clearTimeout(timeout) + reject(new Error(`WebSocket ${index} error: ${error}`)) + }) + }) + }) - let isConnected = false + await Promise.all(connectionPromises) + }) - const timeout = setTimeout(() => { - reject(new Error('WebSocket close test timeout')) - }, 5000) + it('should handle websocket connection close gracefully', { timeout: 10_000 }, async () => { + const wsUrl = `${server.url.replace('http', 'ws')}/_ws` - ws.addEventListener('open', () => { - isConnected = true - // Immediately close the connection to test graceful handling - ws.close(1000, 'Test close') - }) + const wsTest = new Promise((resolve, reject) => { + const ws = new WebSocket(wsUrl) - ws.addEventListener('close', (event) => { - clearTimeout(timeout) - try { - expect(isConnected).toBe(true) - expect(event.code).toBe(1000) - expect(event.reason).toBe('Test close') - resolve() - } - catch (error) { - reject(error) - } - }) + let isConnected = false + + const timeout = setTimeout(() => { + reject(new Error('WebSocket close test timeout')) + }, 5000) + + ws.addEventListener('open', () => { + isConnected = true + // Immediately close the connection to test graceful handling + ws.close(1000, 'Test close') + }) + + ws.addEventListener('close', (event) => { + clearTimeout(timeout) + try { + expect(isConnected).toBe(true) + expect(event.code).toBe(1000) + expect(event.reason).toBe('Test close') + resolve() + } + catch (error) { + reject(error) + } + }) - ws.addEventListener('error', (error) => { - clearTimeout(timeout) - reject(new Error(`WebSocket close test error: ${error}`)) + ws.addEventListener('error', (error) => { + clearTimeout(timeout) + reject(new Error(`WebSocket close test error: ${error}`)) + }) }) - }) - await wsTest + await wsTest + }) }) }) @@ -344,8 +355,9 @@ async function startDevServer(options: { port?: number runtime?: 'node' | 'bun' | 'deno' env?: Record + socketsEnabled?: boolean }): Promise { - const { cwd, port: preferredPort, runtime = 'node', env = {} } = options + const { cwd, port: preferredPort, runtime = 'node', env = {}, socketsEnabled = true } = options const port = preferredPort || await getPort({ port: 3100 }) const host = '127.0.0.1' const url = `http://${host}:${port}` @@ -374,6 +386,7 @@ async function startDevServer(options: { NUXT_TELEMETRY_DISABLED: '1', PORT: String(port), HOST: host, + NUXT_SOCKET: socketsEnabled ? '1' : '0', }, }) From 7ef6a5e9ccebbc7cb4893abbf17ede3e1c7addc1 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 26 Sep 2025 18:33:20 +0300 Subject: [PATCH 02/19] test: enable deno on windows with sockets disabled --- packages/nuxt-cli/test/e2e/runtimes.spec.ts | 37 +++++++++++---------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/packages/nuxt-cli/test/e2e/runtimes.spec.ts b/packages/nuxt-cli/test/e2e/runtimes.spec.ts index 91669f349..c4f3bb439 100644 --- a/packages/nuxt-cli/test/e2e/runtimes.spec.ts +++ b/packages/nuxt-cli/test/e2e/runtimes.spec.ts @@ -35,26 +35,27 @@ type SupportStatus = boolean | { websocketClose: boolean } -const supports: Record = { - node: true, - bun: { - start: true, - fetching: !platform.windows, - websockets: false, - websocketClose: false, - }, - deno: { - start: !platform.windows, - fetching: !platform.windows, - websockets: platform.linux && !platform.windows, - websocketClose: false, - }, -} - -function createIt(status: SupportStatus) { +function createIt(runtimeName: typeof runtimes[number], socketsEnabled: boolean) { function it(description: string, fn: () => Promise): void function it(description: string, options: TestOptions, fn: () => Promise): void function it(description: string, _options: TestOptions | (() => Promise), _fn?: () => Promise): void { + const supportMatrix: Record = { + node: true, + bun: { + start: true, + fetching: !platform.windows, + websockets: false, + websocketClose: false, + }, + deno: { + start: !platform.windows || !socketsEnabled, + fetching: !platform.windows || !socketsEnabled, + websockets: platform.linux || !socketsEnabled, + websocketClose: false || !socketsEnabled, + }, + } + const status = supportMatrix[runtimeName] + const fn = typeof _options === 'function' ? _options : _fn! const options = typeof _options === 'function' ? {} : _options @@ -117,7 +118,7 @@ describe.sequential.each(runtimes)('dev server (%s)', (runtimeName) => { await rm(cwd, { recursive: true, force: true }).catch(() => null) }) - const it = createIt(supports[runtimeName]) + const it = createIt(runtimeName, socketsEnabled) it('should start dev server', { timeout: isCI ? 60_000 : 30_000 }, async () => { rmSync(cwd, { recursive: true, force: true }) From afd2584b6b6cfc55e5c47f3378adb7d254704408 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sat, 27 Sep 2025 12:38:44 +0300 Subject: [PATCH 03/19] test: mark that deno websockets aren't working --- packages/nuxt-cli/test/e2e/runtimes.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nuxt-cli/test/e2e/runtimes.spec.ts b/packages/nuxt-cli/test/e2e/runtimes.spec.ts index c4f3bb439..b72cea4be 100644 --- a/packages/nuxt-cli/test/e2e/runtimes.spec.ts +++ b/packages/nuxt-cli/test/e2e/runtimes.spec.ts @@ -50,8 +50,8 @@ function createIt(runtimeName: typeof runtimes[number], socketsEnabled: boolean) deno: { start: !platform.windows || !socketsEnabled, fetching: !platform.windows || !socketsEnabled, - websockets: platform.linux || !socketsEnabled, - websocketClose: false || !socketsEnabled, + websockets: platform.linux, + websocketClose: false, }, } const status = supportMatrix[runtimeName] From a55b5e3ed4de24eae643e526e30d847f12296f7d Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sat, 27 Sep 2025 12:52:38 +0300 Subject: [PATCH 04/19] test: mark deno dev server doesn't work on windows --- packages/nuxt-cli/test/e2e/runtimes.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nuxt-cli/test/e2e/runtimes.spec.ts b/packages/nuxt-cli/test/e2e/runtimes.spec.ts index b72cea4be..a85129805 100644 --- a/packages/nuxt-cli/test/e2e/runtimes.spec.ts +++ b/packages/nuxt-cli/test/e2e/runtimes.spec.ts @@ -49,7 +49,7 @@ function createIt(runtimeName: typeof runtimes[number], socketsEnabled: boolean) }, deno: { start: !platform.windows || !socketsEnabled, - fetching: !platform.windows || !socketsEnabled, + fetching: !platform.windows, websockets: platform.linux, websocketClose: false, }, From f446b0893ff08df243679f8fca0c0638c36e7bba Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sat, 27 Sep 2025 13:08:12 +0300 Subject: [PATCH 05/19] test: mark deno as working at closing socket on linux --- packages/nuxt-cli/test/e2e/runtimes.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nuxt-cli/test/e2e/runtimes.spec.ts b/packages/nuxt-cli/test/e2e/runtimes.spec.ts index a85129805..db1eb1746 100644 --- a/packages/nuxt-cli/test/e2e/runtimes.spec.ts +++ b/packages/nuxt-cli/test/e2e/runtimes.spec.ts @@ -51,7 +51,7 @@ function createIt(runtimeName: typeof runtimes[number], socketsEnabled: boolean) start: !platform.windows || !socketsEnabled, fetching: !platform.windows, websockets: platform.linux, - websocketClose: false, + websocketClose: false || (!socketsEnabled && platform.linux), }, } const status = supportMatrix[runtimeName] From 49ae0401223a654ad3277425478c42842fd48930 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sat, 27 Sep 2025 13:23:52 +0300 Subject: [PATCH 06/19] test: assert websockets close on linux with deno --- packages/nuxt-cli/test/e2e/runtimes.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nuxt-cli/test/e2e/runtimes.spec.ts b/packages/nuxt-cli/test/e2e/runtimes.spec.ts index db1eb1746..8fdc62403 100644 --- a/packages/nuxt-cli/test/e2e/runtimes.spec.ts +++ b/packages/nuxt-cli/test/e2e/runtimes.spec.ts @@ -51,7 +51,7 @@ function createIt(runtimeName: typeof runtimes[number], socketsEnabled: boolean) start: !platform.windows || !socketsEnabled, fetching: !platform.windows, websockets: platform.linux, - websocketClose: false || (!socketsEnabled && platform.linux), + websocketClose: platform.linux, }, } const status = supportMatrix[runtimeName] From 5db0dcd1b5dd14f08fdc49a35889a4c6563d8983 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sat, 27 Sep 2025 13:34:19 +0300 Subject: [PATCH 07/19] test: bump some timeouts --- packages/nuxt-cli/test/e2e/runtimes.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nuxt-cli/test/e2e/runtimes.spec.ts b/packages/nuxt-cli/test/e2e/runtimes.spec.ts index 8fdc62403..23e6b6468 100644 --- a/packages/nuxt-cli/test/e2e/runtimes.spec.ts +++ b/packages/nuxt-cli/test/e2e/runtimes.spec.ts @@ -277,7 +277,7 @@ describe.sequential.each(runtimes)('dev server (%s)', (runtimeName) => { const timeout = setTimeout(() => { reject(new Error(`WebSocket ${index} connection timeout`)) ws.close() - }, 5000) + }, 20_000) ws.addEventListener('open', () => { ws.send(`ping from connection ${index}`) @@ -312,7 +312,7 @@ describe.sequential.each(runtimes)('dev server (%s)', (runtimeName) => { const timeout = setTimeout(() => { reject(new Error('WebSocket close test timeout')) - }, 5000) + }, 10_000) ws.addEventListener('open', () => { isConnected = true From 6fc6783d17410e362fedcd4742efeee4a9edb62b Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sat, 27 Sep 2025 13:40:45 +0300 Subject: [PATCH 08/19] test: expect deno failure on linux again --- packages/nuxt-cli/test/e2e/runtimes.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nuxt-cli/test/e2e/runtimes.spec.ts b/packages/nuxt-cli/test/e2e/runtimes.spec.ts index 23e6b6468..a95d28a0b 100644 --- a/packages/nuxt-cli/test/e2e/runtimes.spec.ts +++ b/packages/nuxt-cli/test/e2e/runtimes.spec.ts @@ -51,7 +51,7 @@ function createIt(runtimeName: typeof runtimes[number], socketsEnabled: boolean) start: !platform.windows || !socketsEnabled, fetching: !platform.windows, websockets: platform.linux, - websocketClose: platform.linux, + websocketClose: false, }, } const status = supportMatrix[runtimeName] From 1f2b76ff4fb005d7deb529cbac7f2c28e8dac681 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 1 Oct 2025 12:03:57 +0100 Subject: [PATCH 09/19] chore: missing merge content --- packages/nuxt-cli/test/e2e/runtimes.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nuxt-cli/test/e2e/runtimes.spec.ts b/packages/nuxt-cli/test/e2e/runtimes.spec.ts index 1603351eb..536549d38 100644 --- a/packages/nuxt-cli/test/e2e/runtimes.spec.ts +++ b/packages/nuxt-cli/test/e2e/runtimes.spec.ts @@ -120,11 +120,11 @@ describe.sequential.each(runtimes)('dev server (%s)', (runtimeName) => { const it = createIt(runtimeName, socketsEnabled) - it('should start dev server', { timeout: isCI ? 60_000 : 30_000 }, async () => { + it('should start dev server', { timeout: isCI ? 120_000 : 30_000 }, async () => { rmSync(cwd, { recursive: true, force: true }) cpSync(playgroundDir, cwd, { recursive: true, - filter: src => !src.includes('.nuxt') && !src.includes('.output'), + filter: src => !src.includes('.nuxt') && !src.includes('.output') && !src.includes('node_modules'), }) server = await startDevServer({ cwd, From 996e23643539ca45afe63fc6cec219f0ce175f4f Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 1 Oct 2025 22:07:51 +0100 Subject: [PATCH 10/19] test: refactor somewhat --- knip.json | 1 + packages/nuxt-cli/test/e2e/runtimes.spec.ts | 229 +++++++++++--------- 2 files changed, 133 insertions(+), 97 deletions(-) diff --git a/knip.json b/knip.json index 88a08f5a9..cb954048d 100644 --- a/knip.json +++ b/knip.json @@ -45,6 +45,7 @@ "semver", "srvx", "ufo", + "undici", "youch" ] } diff --git a/packages/nuxt-cli/test/e2e/runtimes.spec.ts b/packages/nuxt-cli/test/e2e/runtimes.spec.ts index 536549d38..c8a83804e 100644 --- a/packages/nuxt-cli/test/e2e/runtimes.spec.ts +++ b/packages/nuxt-cli/test/e2e/runtimes.spec.ts @@ -8,8 +8,7 @@ import { join, resolve } from 'node:path' import { fileURLToPath } from 'node:url' import { getPort, waitForPort } from 'get-port-please' import { isCI, isLinux, isMacOS, isWindows } from 'std-env' -import { WebSocket } from 'undici' -import { it as _it, afterAll, describe, expect, vi } from 'vitest' +import { it as _it, afterAll, beforeAll, describe, expect, vi } from 'vitest' const playgroundDir = fileURLToPath(new URL('../../../../playground', import.meta.url)) const nuxiPath = join(fileURLToPath(new URL('../..', import.meta.url)), 'bin/nuxi.mjs') @@ -50,7 +49,7 @@ function createIt(runtimeName: typeof runtimes[number], socketsEnabled: boolean) deno: { start: !platform.windows || !socketsEnabled, fetching: !platform.windows, - websockets: platform.linux || (!socketsEnabled && platform.windows), + websockets: !platform.windows || !socketsEnabled, websocketClose: false, }, } @@ -69,7 +68,7 @@ function createIt(runtimeName: typeof runtimes[number], socketsEnabled: boolean) if (!status.start) { return _it.fails(description, options, fn) } - return _it(description, options, fn) + return beforeAll(fn, options.timeout) } if (!status.start) { return _it.todo(description) @@ -218,128 +217,81 @@ describe.sequential.each(runtimes)('dev server (%s)', (runtimeName) => { it('should establish websocket connection and handle ping/pong', { timeout: 20_000 }, async () => { const wsUrl = `${server.url.replace('http', 'ws')}/_ws` - // Create a promise that resolves when the websocket test is complete - const wsTest = new Promise((resolve, reject) => { - const ws = new WebSocket(wsUrl) - - let isConnected = false - let receivedPong = false - - const timeout = setTimeout(() => { - if (!isConnected) { - reject(new Error('WebSocket connection timeout')) - } - else if (!receivedPong) { - reject(new Error('Did not receive pong response')) - } - ws.close() - }, 20_000) + let isConnected = false + let receivedPong = false - ws.addEventListener('open', () => { + await createWebSocketTest({ + url: wsUrl, + timeout: 20_000, + testId: 'ping/pong', + onOpen: (ws) => { isConnected = true - // Send ping message to test echo functionality ws.send('ping test message') - }) - - ws.addEventListener('message', (event) => { + }, + onMessage: (ws, event) => { const message = event.data.toString() if (message === 'pong') { receivedPong = true - clearTimeout(timeout) ws.close() - resolve() } - }) - - ws.addEventListener('error', (error) => { - clearTimeout(timeout) - reject(new Error(`WebSocket error: ${error}`)) - }) - - ws.addEventListener('close', () => { - if (isConnected && receivedPong) { - resolve() - } - }) + }, + onClose: () => isConnected && receivedPong, }) - - await wsTest }) it('should handle multiple concurrent websocket connections', { timeout: 20_000 }, async () => { const wsUrl = `${server.url.replace('http', 'ws')}/_ws` - const connectionCount = 3 + const connectionCount = 2 const connectionPromises = Array.from({ length: connectionCount }, (_, index) => { - return new Promise((resolve, reject) => { - const ws = new WebSocket(wsUrl) - - const timeout = setTimeout(() => { - reject(new Error(`WebSocket ${index} connection timeout`)) - ws.close() - }, 20_000) + let receivedPong = false - ws.addEventListener('open', () => { + return createWebSocketTest({ + url: wsUrl, + timeout: 20_000, + testId: `concurrent connection ${index}`, + onOpen: (ws) => { ws.send(`ping from connection ${index}`) - }) - - ws.addEventListener('message', (event) => { - const message = event.data.toString() - if (message === 'pong') { - clearTimeout(timeout) + }, + onMessage: (ws, event) => { + if (event.data.toString() === 'pong') { + receivedPong = true ws.close() - resolve() } - }) - - ws.addEventListener('error', (error) => { - clearTimeout(timeout) - reject(new Error(`WebSocket ${index} error: ${error}`)) - }) + }, + onClose: () => receivedPong, }) }) await Promise.all(connectionPromises) }) - it('should handle websocket connection close gracefully', { timeout: 10_000 }, async () => { + it('should handle websocket connection close gracefully', { timeout: 15_000 }, async () => { const wsUrl = `${server.url.replace('http', 'ws')}/_ws` - const wsTest = new Promise((resolve, reject) => { - const ws = new WebSocket(wsUrl) - - let isConnected = false - - const timeout = setTimeout(() => { - reject(new Error('WebSocket close test timeout')) - }, 10_000) - - ws.addEventListener('open', () => { - isConnected = true - // Immediately close the connection to test graceful handling - ws.close(1000, 'Test close') - }) - - ws.addEventListener('close', (event) => { - clearTimeout(timeout) - try { - expect(isConnected).toBe(true) - expect(event.code).toBe(1000) - expect(event.reason).toBe('Test close') - resolve() - } - catch (error) { - reject(error) + let connected = false + let receivedPong = false + + await createWebSocketTest({ + url: wsUrl, + timeout: 12_000, + testId: 'close gracefully', + onOpen: (ws) => { + connected = true + ws.send('ping') + }, + onMessage: (ws, event) => { + if (event.data.toString() === 'pong') { + receivedPong = true + queueMicrotask(() => { + if (ws.readyState === WebSocket.OPEN) { + ws.close(1000, 'Test close') + } + }) } - }) - - ws.addEventListener('error', (error) => { - clearTimeout(timeout) - reject(new Error(`WebSocket close test error: ${error}`)) - }) + }, + onClose: () => connected && receivedPong, }) - - await wsTest }) }) }) @@ -422,3 +374,86 @@ async function startDevServer(options: { }, } } + +interface WebSocketTestOptions { + url: string + timeout?: number + onOpen?: (ws: WebSocket) => void + onMessage?: (ws: WebSocket, event: MessageEvent) => void + onClose?: (ws: WebSocket, event: CloseEvent) => boolean // return true if test should complete successfully + onError?: (ws: WebSocket, error: Event) => void + testId?: string +} + +function createWebSocketTest(options: WebSocketTestOptions): Promise { + const { + url, + timeout = 15_000, + onOpen, + onMessage, + onClose, + onError, + testId = '', + } = options + + return new Promise((resolve, reject) => { + const ws = new WebSocket(url) + let testCompleted = false + let timeoutId: NodeJS.Timeout + + function completeTest(error?: Error) { + if (testCompleted) { + return + } + testCompleted = true + clearTimeout(timeoutId) + + if (error) { + reject(error) + } + else { + resolve() + } + } + + timeoutId = setTimeout(() => { + completeTest(new Error(`WebSocket test timeout${testId ? ` for ${testId}` : ''}`)) + }, timeout) + + ws.addEventListener('open', () => { + if (onOpen) { + onOpen(ws) + } + }) + + ws.addEventListener('message', (event) => { + if (onMessage) { + onMessage(ws, event) + } + }) + + ws.addEventListener('close', (event) => { + if (onClose) { + const shouldComplete = onClose(ws, event) + if (shouldComplete) { + completeTest() + } + else { + completeTest(new Error(`WebSocket test failed${testId ? ` for ${testId}` : ''}`)) + } + } + else { + completeTest() + } + }) + + ws.addEventListener('error', (error) => { + if (onError) { + onError(ws, error) + } + else { + completeTest(new Error(`WebSocket error${testId ? ` for ${testId}` : ''}: ${error}`)) + } + }) + }) +} From 5bd8113907d512d2a40e69d0488ac508266ac29c Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 1 Oct 2025 22:11:58 +0100 Subject: [PATCH 11/19] chore: use undici websocket again --- packages/nuxt-cli/test/e2e/runtimes.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/nuxt-cli/test/e2e/runtimes.spec.ts b/packages/nuxt-cli/test/e2e/runtimes.spec.ts index c8a83804e..c64bd7c86 100644 --- a/packages/nuxt-cli/test/e2e/runtimes.spec.ts +++ b/packages/nuxt-cli/test/e2e/runtimes.spec.ts @@ -4,10 +4,11 @@ import { spawn, spawnSync } from 'node:child_process' import { cpSync, rmSync } from 'node:fs' import { rm } from 'node:fs/promises' import { join, resolve } from 'node:path' - import { fileURLToPath } from 'node:url' + import { getPort, waitForPort } from 'get-port-please' import { isCI, isLinux, isMacOS, isWindows } from 'std-env' +import { WebSocket } from 'undici' import { it as _it, afterAll, beforeAll, describe, expect, vi } from 'vitest' const playgroundDir = fileURLToPath(new URL('../../../../playground', import.meta.url)) From b52b040f0158880b0a6da280e98b8d7b52771a11 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 1 Oct 2025 22:15:29 +0100 Subject: [PATCH 12/19] chore: type --- packages/nuxt-cli/test/e2e/runtimes.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/nuxt-cli/test/e2e/runtimes.spec.ts b/packages/nuxt-cli/test/e2e/runtimes.spec.ts index c64bd7c86..df8f035dd 100644 --- a/packages/nuxt-cli/test/e2e/runtimes.spec.ts +++ b/packages/nuxt-cli/test/e2e/runtimes.spec.ts @@ -1,11 +1,12 @@ import type { ChildProcess } from 'node:child_process' +import type { MessageEvent } from 'undici' import type { TestOptions } from 'vitest' import { spawn, spawnSync } from 'node:child_process' import { cpSync, rmSync } from 'node:fs' import { rm } from 'node:fs/promises' import { join, resolve } from 'node:path' -import { fileURLToPath } from 'node:url' +import { fileURLToPath } from 'node:url' import { getPort, waitForPort } from 'get-port-please' import { isCI, isLinux, isMacOS, isWindows } from 'std-env' import { WebSocket } from 'undici' From d2f9189c38cd24a03181c7c0e6ba34df3272dbb0 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 1 Oct 2025 22:23:36 +0100 Subject: [PATCH 13/19] chore: mark websocket close working on linux --- packages/nuxt-cli/test/e2e/runtimes.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nuxt-cli/test/e2e/runtimes.spec.ts b/packages/nuxt-cli/test/e2e/runtimes.spec.ts index df8f035dd..c3bcdc7fd 100644 --- a/packages/nuxt-cli/test/e2e/runtimes.spec.ts +++ b/packages/nuxt-cli/test/e2e/runtimes.spec.ts @@ -52,7 +52,7 @@ function createIt(runtimeName: typeof runtimes[number], socketsEnabled: boolean) start: !platform.windows || !socketsEnabled, fetching: !platform.windows, websockets: !platform.windows || !socketsEnabled, - websocketClose: false, + websocketClose: platform.linux, }, } const status = supportMatrix[runtimeName] @@ -241,7 +241,7 @@ describe.sequential.each(runtimes)('dev server (%s)', (runtimeName) => { }) }) - it('should handle multiple concurrent websocket connections', { timeout: 20_000 }, async () => { + it('should handle multiple concurrent websocket connections', { timeout: 5_000 }, async () => { const wsUrl = `${server.url.replace('http', 'ws')}/_ws` const connectionCount = 2 From 08fbd846f7c02cc497b43e08596d1119b292a1b5 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 1 Oct 2025 23:07:21 +0100 Subject: [PATCH 14/19] test: drop websocket close test --- .github/workflows/ci.yml | 4 + packages/nuxt-cli/test/e2e/runtimes.spec.ts | 99 ++++++++++----------- 2 files changed, 51 insertions(+), 52 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 012844f7c..be7983b94 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,6 +73,10 @@ jobs: - name: 🧪 Test (unit) run: pnpm test:unit + - name: 🧪 Test (runtimes) + run: pnpm vitest run runtimes --reporter=verbose + timeout-minutes: 10 + - if: matrix.os != 'windows-latest' uses: codecov/codecov-action@v5 diff --git a/packages/nuxt-cli/test/e2e/runtimes.spec.ts b/packages/nuxt-cli/test/e2e/runtimes.spec.ts index c3bcdc7fd..786b4a34c 100644 --- a/packages/nuxt-cli/test/e2e/runtimes.spec.ts +++ b/packages/nuxt-cli/test/e2e/runtimes.spec.ts @@ -33,7 +33,6 @@ type SupportStatus = boolean | { start: boolean fetching: boolean websockets: boolean - websocketClose: boolean } function createIt(runtimeName: typeof runtimes[number], socketsEnabled: boolean) { @@ -46,13 +45,11 @@ function createIt(runtimeName: typeof runtimes[number], socketsEnabled: boolean) start: !platform.windows || !socketsEnabled, fetching: !platform.windows, websockets: false, - websocketClose: false, }, deno: { start: !platform.windows || !socketsEnabled, fetching: !platform.windows, websockets: !platform.windows || !socketsEnabled, - websocketClose: platform.linux, }, } const status = supportMatrix[runtimeName] @@ -61,7 +58,7 @@ function createIt(runtimeName: typeof runtimes[number], socketsEnabled: boolean) const options = typeof _options === 'function' ? {} : _options if (status === false) { - return _it.fails(description, options, fn) + return _it.fails(`${description} [expected to fail with ${runtimeName}]`, options, fn) } if (status === true) { return _it(description, options, fn) @@ -75,15 +72,9 @@ function createIt(runtimeName: typeof runtimes[number], socketsEnabled: boolean) if (!status.start) { return _it.todo(description) } - if (description.includes('websocket connection close gracefully')) { - if (!status.websocketClose) { - return _it.fails(description, options, fn) - } - return _it(description, options, fn) - } if (description.includes('websocket')) { if (!status.websockets) { - return _it.fails(description, options, fn) + return _it.fails(`${description} [expected to fail with ${runtimeName}]`, options, fn) } return _it(description, options, fn) } @@ -216,7 +207,7 @@ describe.sequential.each(runtimes)('dev server (%s)', (runtimeName) => { } }) - it('should establish websocket connection and handle ping/pong', { timeout: 20_000 }, async () => { + it('should establish websocket connection and handle ping/pong', { timeout: 2_000 }, async () => { const wsUrl = `${server.url.replace('http', 'ws')}/_ws` let isConnected = false @@ -224,7 +215,7 @@ describe.sequential.each(runtimes)('dev server (%s)', (runtimeName) => { await createWebSocketTest({ url: wsUrl, - timeout: 20_000, + timeout: 2_000, testId: 'ping/pong', onOpen: (ws) => { isConnected = true @@ -241,7 +232,7 @@ describe.sequential.each(runtimes)('dev server (%s)', (runtimeName) => { }) }) - it('should handle multiple concurrent websocket connections', { timeout: 5_000 }, async () => { + it('should handle multiple concurrent websocket connections', { timeout: 2_000 }, async () => { const wsUrl = `${server.url.replace('http', 'ws')}/_ws` const connectionCount = 2 @@ -250,7 +241,7 @@ describe.sequential.each(runtimes)('dev server (%s)', (runtimeName) => { return createWebSocketTest({ url: wsUrl, - timeout: 20_000, + timeout: 2_000, testId: `concurrent connection ${index}`, onOpen: (ws) => { ws.send(`ping from connection ${index}`) @@ -267,34 +258,6 @@ describe.sequential.each(runtimes)('dev server (%s)', (runtimeName) => { await Promise.all(connectionPromises) }) - - it('should handle websocket connection close gracefully', { timeout: 15_000 }, async () => { - const wsUrl = `${server.url.replace('http', 'ws')}/_ws` - - let connected = false - let receivedPong = false - - await createWebSocketTest({ - url: wsUrl, - timeout: 12_000, - testId: 'close gracefully', - onOpen: (ws) => { - connected = true - ws.send('ping') - }, - onMessage: (ws, event) => { - if (event.data.toString() === 'pong') { - receivedPong = true - queueMicrotask(() => { - if (ws.readyState === WebSocket.OPEN) { - ws.close(1000, 'Test close') - } - }) - } - }, - onClose: () => connected && receivedPong, - }) - }) }) }) @@ -410,6 +373,11 @@ function createWebSocketTest(options: WebSocketTestOptions): Promise { testCompleted = true clearTimeout(timeoutId) + // Ensure WebSocket is closed + if (ws.readyState === WebSocket.OPEN || ws.readyState === WebSocket.CONNECTING) { + ws.close() + } + if (error) { reject(error) } @@ -419,29 +387,51 @@ function createWebSocketTest(options: WebSocketTestOptions): Promise { } timeoutId = setTimeout(() => { - completeTest(new Error(`WebSocket test timeout${testId ? ` for ${testId}` : ''}`)) + const state = ws.readyState === WebSocket.OPEN + ? 'open' + : ws.readyState === WebSocket.CONNECTING + ? 'connecting' + : ws.readyState === WebSocket.CLOSING + ? 'closing' + : 'closed' + completeTest(new Error(`WebSocket test timeout${testId ? ` for ${testId}` : ''} (state: ${state})`)) }, timeout) ws.addEventListener('open', () => { if (onOpen) { - onOpen(ws) + try { + onOpen(ws) + } + catch (error) { + completeTest(error instanceof Error ? error : new Error(String(error))) + } } }) ws.addEventListener('message', (event) => { if (onMessage) { - onMessage(ws, event) + try { + onMessage(ws, event) + } + catch (error) { + completeTest(error instanceof Error ? error : new Error(String(error))) + } } }) ws.addEventListener('close', (event) => { if (onClose) { - const shouldComplete = onClose(ws, event) - if (shouldComplete) { - completeTest() + try { + const shouldComplete = onClose(ws, event) + if (shouldComplete) { + completeTest() + } + else { + completeTest(new Error(`WebSocket test failed${testId ? ` for ${testId}` : ''} (close code: ${event.code})`)) + } } - else { - completeTest(new Error(`WebSocket test failed${testId ? ` for ${testId}` : ''}`)) + catch (error) { + completeTest(error instanceof Error ? error : new Error(String(error))) } } else { @@ -451,7 +441,12 @@ function createWebSocketTest(options: WebSocketTestOptions): Promise { ws.addEventListener('error', (error) => { if (onError) { - onError(ws, error) + try { + onError(ws, error) + } + catch (err) { + completeTest(err instanceof Error ? err : new Error(String(err))) + } } else { completeTest(new Error(`WebSocket error${testId ? ` for ${testId}` : ''}: ${error}`)) From ca17326a0ab6e1c1435dfe71c0272a08b9545bf0 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 1 Oct 2025 23:07:50 +0100 Subject: [PATCH 15/19] ci: drop runtimes test --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be7983b94..012844f7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,10 +73,6 @@ jobs: - name: 🧪 Test (unit) run: pnpm test:unit - - name: 🧪 Test (runtimes) - run: pnpm vitest run runtimes --reporter=verbose - timeout-minutes: 10 - - if: matrix.os != 'windows-latest' uses: codecov/codecov-action@v5 From db003f83907ea20a3f2d2a4d3f30b1cadef6e7e4 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 1 Oct 2025 23:17:34 +0100 Subject: [PATCH 16/19] test: wait to call onOpen callback until readyState is OPEN --- packages/nuxt-cli/test/e2e/runtimes.spec.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/nuxt-cli/test/e2e/runtimes.spec.ts b/packages/nuxt-cli/test/e2e/runtimes.spec.ts index 786b4a34c..f98a30e1f 100644 --- a/packages/nuxt-cli/test/e2e/runtimes.spec.ts +++ b/packages/nuxt-cli/test/e2e/runtimes.spec.ts @@ -42,7 +42,7 @@ function createIt(runtimeName: typeof runtimes[number], socketsEnabled: boolean) const supportMatrix: Record = { node: true, bun: { - start: !platform.windows || !socketsEnabled, + start: !platform.windows, fetching: !platform.windows, websockets: false, }, @@ -397,9 +397,10 @@ function createWebSocketTest(options: WebSocketTestOptions): Promise { completeTest(new Error(`WebSocket test timeout${testId ? ` for ${testId}` : ''} (state: ${state})`)) }, timeout) - ws.addEventListener('open', () => { + ws.addEventListener('open', async () => { if (onOpen) { try { + await vi.waitFor(() => ws.readyState === WebSocket.OPEN) onOpen(ws) } catch (error) { From f7a393ffc5a637098169afb1e6e45f93e9133138 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 1 Oct 2025 23:22:16 +0100 Subject: [PATCH 17/19] test: remove overall test timeouts --- packages/nuxt-cli/test/e2e/runtimes.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nuxt-cli/test/e2e/runtimes.spec.ts b/packages/nuxt-cli/test/e2e/runtimes.spec.ts index f98a30e1f..6f2cf32d9 100644 --- a/packages/nuxt-cli/test/e2e/runtimes.spec.ts +++ b/packages/nuxt-cli/test/e2e/runtimes.spec.ts @@ -207,7 +207,7 @@ describe.sequential.each(runtimes)('dev server (%s)', (runtimeName) => { } }) - it('should establish websocket connection and handle ping/pong', { timeout: 2_000 }, async () => { + it('should establish websocket connection and handle ping/pong', async () => { const wsUrl = `${server.url.replace('http', 'ws')}/_ws` let isConnected = false @@ -232,7 +232,7 @@ describe.sequential.each(runtimes)('dev server (%s)', (runtimeName) => { }) }) - it('should handle multiple concurrent websocket connections', { timeout: 2_000 }, async () => { + it('should handle multiple concurrent websocket connections', async () => { const wsUrl = `${server.url.replace('http', 'ws')}/_ws` const connectionCount = 2 From 89987941ecd44b355e01e35316f4ecf6a9411647 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 2 Oct 2025 10:50:24 +0100 Subject: [PATCH 18/19] test: update compatibility matrix --- packages/nuxt-cli/test/e2e/runtimes.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nuxt-cli/test/e2e/runtimes.spec.ts b/packages/nuxt-cli/test/e2e/runtimes.spec.ts index 6f2cf32d9..40d2f5a20 100644 --- a/packages/nuxt-cli/test/e2e/runtimes.spec.ts +++ b/packages/nuxt-cli/test/e2e/runtimes.spec.ts @@ -47,9 +47,9 @@ function createIt(runtimeName: typeof runtimes[number], socketsEnabled: boolean) websockets: false, }, deno: { - start: !platform.windows || !socketsEnabled, + start: !platform.windows, fetching: !platform.windows, - websockets: !platform.windows || !socketsEnabled, + websockets: !platform.windows && !platform.macos, }, } const status = supportMatrix[runtimeName] From 7b03bd94ad6d37cb358fcf12e115b1fadd0acdb5 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 2 Oct 2025 10:52:04 +0100 Subject: [PATCH 19/19] chore: ignore sockets --- packages/nuxt-cli/test/e2e/runtimes.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nuxt-cli/test/e2e/runtimes.spec.ts b/packages/nuxt-cli/test/e2e/runtimes.spec.ts index 40d2f5a20..e743d7d41 100644 --- a/packages/nuxt-cli/test/e2e/runtimes.spec.ts +++ b/packages/nuxt-cli/test/e2e/runtimes.spec.ts @@ -35,7 +35,7 @@ type SupportStatus = boolean | { websockets: boolean } -function createIt(runtimeName: typeof runtimes[number], socketsEnabled: boolean) { +function createIt(runtimeName: typeof runtimes[number], _socketsEnabled: boolean) { function it(description: string, fn: () => Promise): void function it(description: string, options: TestOptions, fn: () => Promise): void function it(description: string, _options: TestOptions | (() => Promise), _fn?: () => Promise): void {