-
Notifications
You must be signed in to change notification settings - Fork 85
add lit-element #2
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
base: main
Are you sure you want to change the base?
Conversation
Note: jest needs some encouragement to import javascript modules from other javascript modules.
Thanks! I'm not sure what's up with Travis. Is this working for you locally? Also, I just want to make sure. Are you cool with this? 173e638 If not then feel free to close the PR, that's fine. |
No, jest pukes on the lit-html module, which is just a JavaScript module, then complains that is not real js. 🤷♂️. Stay classy, Babel. |
And yeah you can use this example in your course |
babel doesn't transpile files found in |
Could you run Jest with |
Maybe! You could probably just add an import of esm at the top of your test file. Give it a try! |
Ok last commit wrangles jest with modules, but it's not pretty. more info: There's an example here: https://github.com/kenotron/esm-jestwhich requires swapping out the test runner. https://github.com/web-padawan/lit-components/ are using karma with babel transforms, should work out of the box with I've used tape in the past with New Problemdocument is not defined. Going to look into this a bit. |
Maybe this will help? https://github.com/kenotron/esm-jest |
The problem is deeper than than, we need a way to mock the browser in jest justin fagnani over in the polymer slack suggested using puppeteer instead of jest. that would be a major change, but might be worth your considering, especially since the first word in the project title is |
Jest does this by default with jsdom (that's what all the other frameworks are relying on).
Nope. I don't think it's necessary to use puppeteer. All the other frameworks are working fine with the current setup with jest and jsdom. We'll need to figure out how to make this work with the current setup. I don't think adding puppeteer is necessary at all. |
Note: jest needs some encouragement to import javascript modules from other javascript modules.