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

added playwright #22

Open
wants to merge 6 commits into
base: feat/storybook
Choose a base branch
from
Open

added playwright #22

wants to merge 6 commits into from

Conversation

danielgamage
Copy link
Member

Package type

so 2be9e21 is the output of playwright's npm init command, but it was unhappy with our package.json having "type": "module".

npx playwright test output
(node:83172) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Error: playwright.config.ts: Cannot import a typescript file from an esmodule.
================================================================================
Make sure that:
  - you are using Node.js 16+,
  - your package.json contains "type": "module",
  - you are using TypeScript for playwright.config.ts.
================================================================================

...

i tried a whole bunch of weird things to get around the error, like precompiling the typescript to js in a test-out dir, but ran into other issues with that (it couldn't find any tests :o)

removing "type": "module" from our package.json works fine for the test, but we still want it for when we publish to npm. open to ideas about how we can make it work for both cases!

Storybook

got the web component tests working, using storybook as the reference for it, but it only works when storybook is already running. otherwise it takes SO long to boot up.

we could precompile the storybook in ci, then reference the static html file in the webserver (we might need to do this to host the storybook anyways), or write a custom html page. both seem complicated, but also open to ideas on this front

@mikabusante
Copy link
Contributor

Error: playwright.config.ts: Cannot import a typescript file from an esmodule.

trying to repro -- this error comes up when adding "type": "module" back to the package.json and then running npx playwright test ya?

@mikabusante
Copy link
Contributor

Screen Shot 2022-05-17 at 1 59 57 PM

Also after adding back "type": "module", I saw this error, but after removing the Page import, the tests run and pass??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants