Skip to content
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

fix(testing): add playwright secondary entrypoint for preset #18202

Conversation

barbados-clemens
Copy link
Contributor

Current Behavior

microsoft/playwright#19798

when importing from @playwright/test, expect is overridden causing issues with global jest expect.
therefore test start failing with

•app > -mlnlmal > should sklp "nx-welcome.component.ts" flle and references for standalone apps wlth routlng
toMatchsnapshot() must be called durlng the test
700 1
701 1
> 702 1
// check to see if the workspace configuration has been updated to turn off
// strict mode by default in future 8ppIic8tions
const nxJson re8dJson<NxJsonConf igur8tion>(appTree, ' nx. j son, ).
703 1
704 1 i)
705 1 1),
expect(nxJson.generators [, @nx/8ngular: appllcatlon, ]. strlct). toBe(f alse).
at Object.toMatchSnapshot ( .. I.. /node_modules/. pnpm/@[email protected]. 1/node_module @playwright/test/lib/matchers/toMatchsnapshot. j s
4.24)
at EXTERNAL MATCHER TRAP ( .. /.. /node_modules/. pnpm/expect@29. 5.0/node_modules/expect/build/index. j s: 317: 30)
at Ob j ect.throwingMatcher ( . / . /node_modules/. pnpm/expect@29. 5.O/node_modules/expect/build/index. js: 318: 15)
at src/generators/application/application. spec.ts: 702.82
at f ulf illed ( .. / .. /node_modules/. pnpm/[email protected]/node_modules/tslib/tslib. j s: 115: 62)

This happens because the playwright e2e preset file imports from @playwright/test; therfore,
importing from the main index.ts causing @playwright/test to be imported into jest program

Expected Behavior

a secondary entrypoint for the playwright preset should be used instead of the main index file.

Related Issue(s)

Fixes #

@vercel
Copy link

vercel bot commented Jul 19, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 19, 2023 9:12pm

@barbados-clemens barbados-clemens force-pushed the fix/playwright-preset-entrypiont branch from 1338ef1 to b1a7f67 Compare July 19, 2023 20:40
@barbados-clemens barbados-clemens force-pushed the fix/playwright-preset-entrypiont branch from 0726d6a to aa2c722 Compare July 19, 2023 21:08
@barbados-clemens barbados-clemens changed the title fix(testing): add preset secondary entrypoint fix(testing): add playwright secondary entrypoint for preset Jul 19, 2023
@barbados-clemens barbados-clemens enabled auto-merge (squash) July 19, 2023 21:59
@barbados-clemens barbados-clemens merged commit b7fb3ea into nrwl:master Jul 20, 2023
@barbados-clemens barbados-clemens deleted the fix/playwright-preset-entrypiont branch July 20, 2023 16:52
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants