Skip to content

Commit ef72f9f

Browse files
committed
test(e2e): fix unexpected error logs
1 parent 5bc3389 commit ef72f9f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

e2e/cases/decorator/2022-03/index.test.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { test, expect } from '@playwright/test';
2-
import { build, gotoPage, rspackOnlyTest } from '@e2e/helper';
2+
import { build, gotoPage, proxyConsole, rspackOnlyTest } from '@e2e/helper';
33
import { pluginBabel } from '@rsbuild/plugin-babel';
44

55
test('should run stage 3 decorators correctly', async ({ page }) => {
@@ -37,6 +37,8 @@ rspackOnlyTest(
3737
test.fail(
3838
'stage 3 decorators do not support decoratorBeforeExport',
3939
async ({ page }) => {
40+
const { logs, restore } = proxyConsole();
41+
4042
// SyntaxError: Decorators must be placed *after* the 'export' keyword
4143
const rsbuild = await build({
4244
cwd: __dirname,
@@ -56,5 +58,15 @@ test.fail(
5658
expect(await page.evaluate('window.method')).toBe('targetMethod');
5759
expect(await page.evaluate('window.field')).toBe('message');
5860
await rsbuild.close();
61+
62+
expect(
63+
logs.find((log) =>
64+
log.includes(
65+
'Using the export keyword between a decorator and a class is not allowed',
66+
),
67+
),
68+
).toBeTruthy();
69+
70+
restore();
5971
},
6072
);

0 commit comments

Comments
 (0)