File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
e2e/cases/decorator/2022-03 Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
1
import { test , expect } from '@playwright/test' ;
2
- import { build , gotoPage , rspackOnlyTest } from '@e2e/helper' ;
2
+ import { build , gotoPage , proxyConsole , rspackOnlyTest } from '@e2e/helper' ;
3
3
import { pluginBabel } from '@rsbuild/plugin-babel' ;
4
4
5
5
test ( 'should run stage 3 decorators correctly' , async ( { page } ) => {
@@ -37,6 +37,8 @@ rspackOnlyTest(
37
37
test . fail (
38
38
'stage 3 decorators do not support decoratorBeforeExport' ,
39
39
async ( { page } ) => {
40
+ const { logs, restore } = proxyConsole ( ) ;
41
+
40
42
// SyntaxError: Decorators must be placed *after* the 'export' keyword
41
43
const rsbuild = await build ( {
42
44
cwd : __dirname ,
@@ -56,5 +58,15 @@ test.fail(
56
58
expect ( await page . evaluate ( 'window.method' ) ) . toBe ( 'targetMethod' ) ;
57
59
expect ( await page . evaluate ( 'window.field' ) ) . toBe ( 'message' ) ;
58
60
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 ( ) ;
59
71
} ,
60
72
) ;
You can’t perform that action at this time.
0 commit comments