|
1 | | -import { test } from '@e2e/helper'; |
| 1 | +import { rspackTest } from '@e2e/helper'; |
2 | 2 |
|
3 | | -test('should forward browser unhandled rejection logs to terminal', async ({ |
4 | | - dev, |
5 | | -}) => { |
6 | | - const rsbuild = await dev(); |
7 | | - await rsbuild.expectLog('error [browser] Uncaught (in promise) 404'); |
8 | | - await rsbuild.expectLog('error [browser] Uncaught (in promise) false'); |
9 | | - await rsbuild.expectLog('error [browser] Uncaught (in promise) null'); |
10 | | - await rsbuild.expectLog('error [browser] Uncaught (in promise) undefined'); |
11 | | - await rsbuild.expectLog('error [browser] Uncaught (in promise) string'); |
12 | | - await rsbuild.expectLog( |
13 | | - 'error [browser] Uncaught (in promise) {"name":"Custom","message":"custom message"}', |
14 | | - ); |
15 | | - await rsbuild.expectLog( |
16 | | - 'error [browser] Uncaught (in promise) Error: reason (src/index.js:7:0)', |
17 | | - { posix: true }, |
18 | | - ); |
19 | | - await rsbuild.expectLog( |
20 | | - 'error [browser] Uncaught (in promise) AbortError: Aborted', |
21 | | - ); |
22 | | - await rsbuild.expectLog( |
23 | | - 'error [browser] Uncaught (in promise) Error: Thrown in async (src/index.js:11:0)', |
24 | | - { posix: true }, |
25 | | - ); |
26 | | - await rsbuild.expectLog( |
27 | | - 'error [browser] Uncaught (in promise) AbortError: signal is aborted without reason (src/index.js:16:0)', |
28 | | - { posix: true }, |
29 | | - ); |
30 | | -}); |
| 3 | +rspackTest( |
| 4 | + 'should forward browser unhandled rejection logs to terminal', |
| 5 | + async ({ dev }) => { |
| 6 | + const rsbuild = await dev(); |
| 7 | + await rsbuild.expectLog('error [browser] Uncaught (in promise) 404'); |
| 8 | + await rsbuild.expectLog('error [browser] Uncaught (in promise) false'); |
| 9 | + await rsbuild.expectLog('error [browser] Uncaught (in promise) null'); |
| 10 | + await rsbuild.expectLog( |
| 11 | + 'error [browser] Uncaught (in promise) undefined', |
| 12 | + ); |
| 13 | + await rsbuild.expectLog('error [browser] Uncaught (in promise) string'); |
| 14 | + await rsbuild.expectLog( |
| 15 | + 'error [browser] Uncaught (in promise) {"name":"Custom","message":"custom message"}', |
| 16 | + ); |
| 17 | + await rsbuild.expectLog( |
| 18 | + 'error [browser] Uncaught (in promise) Error: reason (src/index.js:7:0)', |
| 19 | + { posix: true }, |
| 20 | + ); |
| 21 | + await rsbuild.expectLog( |
| 22 | + 'error [browser] Uncaught (in promise) AbortError: Aborted', |
| 23 | + ); |
| 24 | + await rsbuild.expectLog( |
| 25 | + 'error [browser] Uncaught (in promise) Error: Thrown in async (src/index.js:11:0)', |
| 26 | + { posix: true }, |
| 27 | + ); |
| 28 | + await rsbuild.expectLog( |
| 29 | + 'error [browser] Uncaught (in promise) AbortError: signal is aborted without reason (src/index.js:16:0)', |
| 30 | + { posix: true }, |
| 31 | + ); |
| 32 | + }, |
| 33 | +); |
0 commit comments