playwright/packages/playwright-test
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
..
src fix(test runner): show codeframe and location from the error top stack frame (#11179) 2022-01-04 16:00:55 -08:00
types test: expose repeatEachIndex (#11158) 2022-01-03 17:29:54 -08:00
.npmignore fix(npm): don't ship src in @playwright/test and ensure we ship cli.js in playwright-core 2021-10-22 16:15:57 -04:00
cli.js fix(monorepo): support yarn2/pnp by specifying all deps and bins (#9620) 2021-10-19 14:49:47 -04:00
index.d.ts chore: move test runner types into the playwright test package (#9472) 2021-10-14 11:55:08 +02:00
index.js fix(monorepo): explicitly list package.json exports instead of using glob patterns (#9584) 2021-10-19 12:28:02 -04:00
index.mjs chore: migrate to monorepo (#9421) 2021-10-11 16:52:17 +02:00
package.json chore: parse tsx tests (#10917) 2021-12-14 19:25:07 -08:00
README.md chore: add README's for packages (#9432) 2021-10-11 19:28:10 +02:00
reporter.d.ts chore: move test runner types into the playwright test package (#9472) 2021-10-14 11:55:08 +02:00
reporter.js feat(test-runner): export reporter api as @playwright/test/reporter (#7692) 2021-07-16 21:15:03 -07:00
reporter.mjs feat(test-runner): export reporter api as @playwright/test/reporter (#7692) 2021-07-16 21:15:03 -07:00

@playwright/test

This package contains Playwright Test. A test-runner for writing idiomatic and reliable end-to-end tests with Playwright.