diff --git a/playground/hasWindowsUnicodeFsBug.js b/playground/hasWindowsUnicodeFsBug.js deleted file mode 100644 index c46dd2a55..000000000 --- a/playground/hasWindowsUnicodeFsBug.js +++ /dev/null @@ -1,10 +0,0 @@ -import os from 'node:os' - -const isWindows = os.platform() === 'win32' -const nodeVersionArray = process.versions.node.split('.') -// ignore some files due to https://github.com/nodejs/node/issues/48673 -// node <=21.0.0 and ^20.4.0 has the bug -export const hasWindowsUnicodeFsBug = - isWindows && - (+nodeVersionArray[0] > 20 || - (+nodeVersionArray[0] === 20 && +nodeVersionArray[1] >= 4)) diff --git a/playground/hmr-ssr/__tests__/hmr-ssr.spec.ts b/playground/hmr-ssr/__tests__/hmr-ssr.spec.ts index f28b620f5..6a2b3763b 100644 --- a/playground/hmr-ssr/__tests__/hmr-ssr.spec.ts +++ b/playground/hmr-ssr/__tests__/hmr-ssr.spec.ts @@ -253,7 +253,7 @@ describe('hmr works correctly', () => { }) // TODO - // test.skipIf(hasWindowsUnicodeFsBug)('full-reload encodeURI path', async () => { + // test('full-reload encodeURI path', async () => { // await page.goto( // viteTestUrl + '/unicode-path/中文-にほんご-한글-🌕🌖🌗/index.html', // ) diff --git a/playground/hmr/__tests__/hmr.spec.ts b/playground/hmr/__tests__/hmr.spec.ts index 27590bd60..eb7b66d3c 100644 --- a/playground/hmr/__tests__/hmr.spec.ts +++ b/playground/hmr/__tests__/hmr.spec.ts @@ -1,6 +1,5 @@ import { beforeAll, describe, expect, it, test } from 'vitest' import type { Page } from 'playwright-chromium' -import { hasWindowsUnicodeFsBug } from '../../hasWindowsUnicodeFsBug' import { addFile, browser, @@ -253,24 +252,21 @@ if (!isBuild) { await untilUpdated(() => el.textContent(), '3') }) - test.skipIf(hasWindowsUnicodeFsBug)( - 'full-reload encodeURI path', - async () => { - await page.goto( - viteTestUrl + '/unicode-path/中文-にほんご-한글-🌕🌖🌗/index.html', - ) - const el = await page.$('#app') - expect(await el.textContent()).toBe('title') - editFile('unicode-path/中文-にほんご-한글-🌕🌖🌗/index.html', (code) => - code.replace('title', 'title2'), - ) - await page.waitForEvent('load') - await untilUpdated( - async () => (await page.$('#app')).textContent(), - 'title2', - ) - }, - ) + test('full-reload encodeURI path', async () => { + await page.goto( + viteTestUrl + '/unicode-path/中文-にほんご-한글-🌕🌖🌗/index.html', + ) + const el = await page.$('#app') + expect(await el.textContent()).toBe('title') + editFile('unicode-path/中文-にほんご-한글-🌕🌖🌗/index.html', (code) => + code.replace('title', 'title2'), + ) + await page.waitForEvent('load') + await untilUpdated( + async () => (await page.$('#app')).textContent(), + 'title2', + ) + }) test('CSS update preserves query params', async () => { await page.goto(viteTestUrl) diff --git a/playground/html/__tests__/html.spec.ts b/playground/html/__tests__/html.spec.ts index 687629d91..85ceea961 100644 --- a/playground/html/__tests__/html.spec.ts +++ b/playground/html/__tests__/html.spec.ts @@ -1,5 +1,4 @@ import { beforeAll, describe, expect, test } from 'vitest' -import { hasWindowsUnicodeFsBug } from '../../hasWindowsUnicodeFsBug' import { browserLogs, editFile, @@ -220,7 +219,7 @@ describe('noBody', () => { }) }) -describe.skipIf(hasWindowsUnicodeFsBug)('Unicode path', () => { +describe('Unicode path', () => { test('direct access', async () => { await page.goto( viteTestUrl + '/unicode-path/中文-にほんご-한글-🌕🌖🌗/index.html', diff --git a/playground/html/vite.config.js b/playground/html/vite.config.js index 4452200a0..f8c14eef4 100644 --- a/playground/html/vite.config.js +++ b/playground/html/vite.config.js @@ -1,6 +1,5 @@ import { relative, resolve } from 'node:path' import { defineConfig } from 'vite' -import { hasWindowsUnicodeFsBug } from '../hasWindowsUnicodeFsBug' export default defineConfig({ base: './', @@ -21,14 +20,10 @@ export default defineConfig({ inline1: resolve(__dirname, 'inline/shared-1.html'), inline2: resolve(__dirname, 'inline/shared-2.html'), inline3: resolve(__dirname, 'inline/unique.html'), - ...(hasWindowsUnicodeFsBug - ? {} - : { - unicodePath: resolve( - __dirname, - 'unicode-path/中文-にほんご-한글-🌕🌖🌗/index.html', - ), - }), + unicodePath: resolve( + __dirname, + 'unicode-path/中文-にほんご-한글-🌕🌖🌗/index.html', + ), linkProps: resolve(__dirname, 'link-props/index.html'), valid: resolve(__dirname, 'valid.html'), importmapOrder: resolve(__dirname, 'importmapOrder.html'), diff --git a/playground/vitestGlobalSetup.ts b/playground/vitestGlobalSetup.ts index 7f85d9d12..3a8288ab3 100644 --- a/playground/vitestGlobalSetup.ts +++ b/playground/vitestGlobalSetup.ts @@ -3,7 +3,6 @@ import fs from 'fs-extra' import type { GlobalSetupContext } from 'vitest/node' import type { BrowserServer } from 'playwright-chromium' import { chromium } from 'playwright-chromium' -import { hasWindowsUnicodeFsBug } from './hasWindowsUnicodeFsBug' let browserServer: BrowserServer | undefined @@ -28,9 +27,6 @@ export async function setup({ provide }: GlobalSetupContext): Promise { .copy(path.resolve(__dirname, '../playground'), tempDir, { dereference: false, filter(file) { - if (file.includes('中文-にほんご-한글-🌕🌖🌗')) { - return !hasWindowsUnicodeFsBug - } file = file.replace(/\\/g, '/') return !file.includes('__tests__') && !/dist(?:\/|$)/.test(file) },