Skip to content

Commit

Permalink
test: try to fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan committed Sep 8, 2024
1 parent 4a79f89 commit fc33080
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
24 changes: 20 additions & 4 deletions test/jsx-hmr/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@ import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { type Page, expect, test } from '@playwright/test';
import { createRsbuild, loadConfig } from '@rsbuild/core';
import { pluginVueJsx } from '../../src';
import { getRandomPort } from '../helper';

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

test('should render', async ({ page }) => {
const rsbuild = await createRsbuild({
cwd: __dirname,
rsbuildConfig: (await loadConfig({ cwd: __dirname })).content,
rsbuildConfig: {
...(await loadConfig({ cwd: __dirname })).content,
server: {
port: getRandomPort(),
},
},
});

const { server, urls } = await rsbuild.startDevServer();
Expand All @@ -32,7 +37,12 @@ test('should render', async ({ page }) => {
test('should update', async ({ page }) => {
const rsbuild = await createRsbuild({
cwd: __dirname,
rsbuildConfig: (await loadConfig({ cwd: __dirname })).content,
rsbuildConfig: {
...(await loadConfig({ cwd: __dirname })).content,
server: {
port: getRandomPort(),
},
},
});

const { server, urls } = await rsbuild.startDevServer();
Expand Down Expand Up @@ -74,7 +84,12 @@ test.describe('vue jsx hmr', () => {
page = await browser.newPage();
const rsbuild = await createRsbuild({
cwd: __dirname,
rsbuildConfig: (await loadConfig({ cwd: __dirname })).content,
rsbuildConfig: {
...(await loadConfig({ cwd: __dirname })).content,
server: {
port: getRandomPort(),
},
},
});

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

// not pass
// see https://github.com/web-infra-dev/rsbuild/pull/2018
test.skip('hmr: vue script lang=jsx', async () => {
await page.locator('.script').click();
await expect(page.locator('.script')).toHaveText('script 5');
Expand Down
4 changes: 0 additions & 4 deletions test/jsx-hmr/rsbuild.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { defineConfig } from '@rsbuild/core';
import { pluginBabel } from '@rsbuild/plugin-babel';
import { pluginVue } from '@rsbuild/plugin-vue';
import { pluginVueJsx } from '@rsbuild/plugin-vue-jsx';
import { getRandomPort } from '../helper';

export default defineConfig({
plugins: [
Expand All @@ -12,9 +11,6 @@ export default defineConfig({
}),
pluginVueJsx(),
],
server: {
port: getRandomPort(),
},
performance: {
buildCache: false,
},
Expand Down

0 comments on commit fc33080

Please sign in to comment.