|
3 | 3 | const HOST = `http://localhost:${process.env.PORT}`;
|
4 | 4 |
|
5 | 5 | describe('Wasm', () => {
|
6 |
| - it('captured exception should include modified frames and debug_meta attribute', async () => { |
7 |
| - await page.goto(HOST); |
8 |
| - const event = await page.evaluate(async () => { |
9 |
| - return window.getEvent(); |
10 |
| - }); |
| 6 | + // TODO: This is a quick and dirty way to test the minified browser bundle - `min-bundle.html` is an exact replica of |
| 7 | + // `index.html` save the browser bundle `src` value. In the long run, we should rig it so just the bundle can be |
| 8 | + // passed in. (Or, once the new bundling process is nailed down, stop testing against the minified bundle, since |
| 9 | + // that's not really what this test is for.) |
| 10 | + ['index.html', 'min-bundle.html'].forEach(pagePath => |
| 11 | + it(`captured exception should include modified frames and debug_meta attribute - ${pagePath}`, async () => { |
| 12 | + await page.goto(`${HOST}/${pagePath}`); |
| 13 | + const event = await page.evaluate(async () => { |
| 14 | + return window.getEvent(); |
| 15 | + }); |
11 | 16 |
|
12 |
| - expect(event.exception.values[0].stacktrace.frames).toEqual( |
13 |
| - expect.arrayContaining([ |
14 |
| - expect.objectContaining({ |
15 |
| - filename: `${HOST}/simple.wasm`, |
16 |
| - function: 'internal_func', |
17 |
| - in_app: true, |
18 |
| - instruction_addr: '0x8c', |
19 |
| - addr_mode: 'rel:0', |
20 |
| - platform: 'native', |
21 |
| - }), |
22 |
| - expect.objectContaining({ |
23 |
| - filename: `${HOST}/`, |
24 |
| - function: 'crash', |
25 |
| - in_app: true, |
26 |
| - }), |
27 |
| - ]), |
28 |
| - ); |
| 17 | + expect(event.exception.values[0].stacktrace.frames).toEqual( |
| 18 | + expect.arrayContaining([ |
| 19 | + expect.objectContaining({ |
| 20 | + filename: `${HOST}/simple.wasm`, |
| 21 | + function: 'internal_func', |
| 22 | + in_app: true, |
| 23 | + instruction_addr: '0x8c', |
| 24 | + addr_mode: 'rel:0', |
| 25 | + platform: 'native', |
| 26 | + }), |
| 27 | + expect.objectContaining({ |
| 28 | + filename: `${HOST}/${pagePath}`, |
| 29 | + function: 'crash', |
| 30 | + in_app: true, |
| 31 | + }), |
| 32 | + ]), |
| 33 | + ); |
29 | 34 |
|
30 |
| - expect(event.debug_meta).toMatchObject({ |
31 |
| - images: [ |
32 |
| - { |
33 |
| - code_file: `${HOST}/simple.wasm`, |
34 |
| - code_id: '0ba020cdd2444f7eafdd25999a8e9010', |
35 |
| - debug_file: null, |
36 |
| - debug_id: '0ba020cdd2444f7eafdd25999a8e90100', |
37 |
| - type: 'wasm', |
38 |
| - }, |
39 |
| - ], |
40 |
| - }); |
41 |
| - }); |
| 35 | + expect(event.debug_meta).toMatchObject({ |
| 36 | + images: [ |
| 37 | + { |
| 38 | + code_file: `${HOST}/simple.wasm`, |
| 39 | + code_id: '0ba020cdd2444f7eafdd25999a8e9010', |
| 40 | + debug_file: null, |
| 41 | + debug_id: '0ba020cdd2444f7eafdd25999a8e90100', |
| 42 | + type: 'wasm', |
| 43 | + }, |
| 44 | + ], |
| 45 | + }); |
| 46 | + }), |
| 47 | + ); |
42 | 48 | });
|
0 commit comments