-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: Port onerror tests to playwright #11666
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
...s/browser-integration-tests/suites/public-api/instrumentation/onError/non-string-arg/test.ts
Outdated
Show resolved
Hide resolved
General comment; not blocking this PR: Long-term, I'd like us to move away from these kinds of workarounds where we simulate something that rather than doing it more "naturally". This behaviour doesn't resemble how errors would actually be thrown a real-life project. Because of the "Script Error" limitation we have very few tests where we just throw errors naturally. To be fair, calling I opened #11678 to track this more broadly. |
…umentation/onError/non-string-arg/test.ts Co-authored-by: Lukas Stracke <[email protected]>
size-limit report 📦
|
ref #11084 This test ports `packages/browser/test/integration/suites/onunhandledrejection.js` playwright. Because of the same limitations as outlined with the on error tests #11666, I had to use calls to `window.onunhandledrejection` to simulate these tests instead of just using `Promise.reject` to test the handler. #11678 tracks being able to fix this so we can avoid directly calling `window.onunhandledrejection` to test. As `onunhandledrejection.js` was the last suite to use the old integration tests, I fully removed that code and the corresponding GH action workflow. I also removed the monorepo deps on `karma`, `chai` and `sinon`. Extremely satisfying.
Trying #11543 again.
This ports
packages/browser/test/integration/suites/onerror.js
to playwright. Because I couldn't throw top level errors without generating script errors, I elected to simulatewindow.onerror
being called.ref #11084