Skip to content

Commit

Permalink
test: don't skip unicode related tests anymore (#16339)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed May 7, 2024
1 parent 6711553 commit c2a4ce5
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 45 deletions.
10 changes: 0 additions & 10 deletions playground/hasWindowsUnicodeFsBug.js

This file was deleted.

2 changes: 1 addition & 1 deletion playground/hmr-ssr/__tests__/hmr-ssr.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
// )
Expand Down
34 changes: 15 additions & 19 deletions playground/hmr/__tests__/hmr.spec.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions playground/html/__tests__/html.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { beforeAll, describe, expect, test } from 'vitest'
import { hasWindowsUnicodeFsBug } from '../../hasWindowsUnicodeFsBug'
import {
browserLogs,
editFile,
Expand Down Expand Up @@ -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',
Expand Down
13 changes: 4 additions & 9 deletions playground/html/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { relative, resolve } from 'node:path'
import { defineConfig } from 'vite'
import { hasWindowsUnicodeFsBug } from '../hasWindowsUnicodeFsBug'

export default defineConfig({
base: './',
Expand All @@ -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'),
Expand Down
4 changes: 0 additions & 4 deletions playground/vitestGlobalSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -28,9 +27,6 @@ export async function setup({ provide }: GlobalSetupContext): Promise<void> {
.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)
},
Expand Down

0 comments on commit c2a4ce5

Please sign in to comment.