playwright/packages
Dmitry Gozman 16a779a5ff
fix(test runner): show codeframe and location from the error top stack frame (#11179)
Previously, reporter would look for a stack frame directly in the test file.
Often times, that is not a top stack frame, especially when the test uses
some helper functions.

This changes error snippets and locations to use the top frame. When top
frame does not match the test file, we additionally show the location
to avoid confusion:

```
  1) a.spec.ts:7:7 › foobar ========================================================================

    Error: oh my

       at helper.ts:5

      3 |
      4 |       export function ohMy() {
    > 5 |         throw new Error('oh my');
        |               ^
      6 |       }
      7 |

        at ohMy (.../reporter-base-should-print-codeframe-from-a-helper/helper.ts:5:15)
        at .../reporter-base-should-print-codeframe-from-a-helper/a.spec.ts:8:9
        at FixtureRunner.resolveParametersAndRunHookOrTest (.../src/fixtures.ts:281:12)
```
2022-01-04 16:00:55 -08:00
..
html-reporter feat(html): group similar items in the report (#11160) 2022-01-03 21:17:17 -08:00
playwright chore: cut v1.17 (#10203) 2021-11-09 17:56:26 -08:00
playwright-chromium chore: cut v1.17 (#10203) 2021-11-09 17:56:26 -08:00
playwright-core devops: fix self-hosted runner stack collection (#11169) 2022-01-04 06:23:28 -08:00
playwright-firefox chore: cut v1.17 (#10203) 2021-11-09 17:56:26 -08:00
playwright-test fix(test runner): show codeframe and location from the error top stack frame (#11179) 2022-01-04 16:00:55 -08:00
playwright-webkit chore: cut v1.17 (#10203) 2021-11-09 17:56:26 -08:00