Skip to content

Commit fc33080

Browse files
committed
test: try to fix CI
1 parent 4a79f89 commit fc33080

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

test/jsx-hmr/index.test.ts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,19 @@ import path from 'node:path';
33
import { fileURLToPath } from 'node:url';
44
import { type Page, expect, test } from '@playwright/test';
55
import { createRsbuild, loadConfig } from '@rsbuild/core';
6-
import { pluginVueJsx } from '../../src';
6+
import { getRandomPort } from '../helper';
77

88
const __dirname = path.dirname(fileURLToPath(import.meta.url));
99

1010
test('should render', async ({ page }) => {
1111
const rsbuild = await createRsbuild({
1212
cwd: __dirname,
13-
rsbuildConfig: (await loadConfig({ cwd: __dirname })).content,
13+
rsbuildConfig: {
14+
...(await loadConfig({ cwd: __dirname })).content,
15+
server: {
16+
port: getRandomPort(),
17+
},
18+
},
1419
});
1520

1621
const { server, urls } = await rsbuild.startDevServer();
@@ -32,7 +37,12 @@ test('should render', async ({ page }) => {
3237
test('should update', async ({ page }) => {
3338
const rsbuild = await createRsbuild({
3439
cwd: __dirname,
35-
rsbuildConfig: (await loadConfig({ cwd: __dirname })).content,
40+
rsbuildConfig: {
41+
...(await loadConfig({ cwd: __dirname })).content,
42+
server: {
43+
port: getRandomPort(),
44+
},
45+
},
3646
});
3747

3848
const { server, urls } = await rsbuild.startDevServer();
@@ -74,7 +84,12 @@ test.describe('vue jsx hmr', () => {
7484
page = await browser.newPage();
7585
const rsbuild = await createRsbuild({
7686
cwd: __dirname,
77-
rsbuildConfig: (await loadConfig({ cwd: __dirname })).content,
87+
rsbuildConfig: {
88+
...(await loadConfig({ cwd: __dirname })).content,
89+
server: {
90+
port: getRandomPort(),
91+
},
92+
},
7893
});
7994

8095
const result = await rsbuild.startDevServer();
@@ -172,6 +187,7 @@ test.describe('vue jsx hmr', () => {
172187
});
173188

174189
// not pass
190+
// see https://github.com/web-infra-dev/rsbuild/pull/2018
175191
test.skip('hmr: vue script lang=jsx', async () => {
176192
await page.locator('.script').click();
177193
await expect(page.locator('.script')).toHaveText('script 5');

test/jsx-hmr/rsbuild.config.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { defineConfig } from '@rsbuild/core';
22
import { pluginBabel } from '@rsbuild/plugin-babel';
33
import { pluginVue } from '@rsbuild/plugin-vue';
44
import { pluginVueJsx } from '@rsbuild/plugin-vue-jsx';
5-
import { getRandomPort } from '../helper';
65

76
export default defineConfig({
87
plugins: [
@@ -12,9 +11,6 @@ export default defineConfig({
1211
}),
1312
pluginVueJsx(),
1413
],
15-
server: {
16-
port: getRandomPort(),
17-
},
1814
performance: {
1915
buildCache: false,
2016
},

0 commit comments

Comments
 (0)