microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
66.4k stars 3.63k forks source link

[internal] failing tests in Node.js 21 #28524

Closed mxschmitt closed 9 months ago

mxschmitt commented 10 months ago
    [playwright-test] › esm.spec.ts:138:5 › should use source maps ─────────────────────────────────
    [playwright-test] › esm.spec.ts:160:5 › should show the codeframe in errors ────────────────────
    [playwright-test] › esm.spec.ts:200:5 › should filter by line ──────────────────────────────────
    [playwright-test] › esm.spec.ts:481:5 › should resolve .js import to .tsx file in ESM mode for components 
    [playwright-test] › playwright.fetch.spec.ts:54:5 › should stop tracing on requestContext.dispose() 
    [playwright-test] › reporter-blob.spec.ts:593:1 › generate html with attachment urls ───────────
    [playwright-test] › reporter-html.spec.ts:224:5 › created › should include image diffs for same expectation 
    [playwright-test] › ui-mode-test-ct.spec.ts:113:5 › should run component tests after editing test and component 
    [playwright-test] › ui-mode-test-screencast.spec.ts:21:5 › should show screenshots ─────────────
    [playwright-test] › watch.spec.ts:60:5 › should print dependencies in ESM mode ─────────────────
    [playwright-test] › watch.spec.ts:377:5 › should run on changed deps in ESM ────────────────────
    [playwright-test] › watch.spec.ts:653:5 › should run CT on indirect deps change ESM mode ───────

and library/browsercontext-fetch.spec.ts:788:3

mxschmitt commented 10 months ago

Caused by deprecated globalPreload look: https://nodejs.org/en/blog/announcements/v21-release-announce

jdalton commented 9 months ago

:wave: @mxschmitt! I'm been digging into the playwright repo and how it runs its own unit tests. Are the loader hooks something that is used in public APIs or just internally? How does it fit into playwright?

mxschmitt commented 9 months ago

hey, afaik we use it in order to allow TS transpilation in ESM mode, since in ESM mode pirates is not able to intercept the import calls.

mxschmitt commented 9 months ago

Closing since this issue has been solved.