-
Notifications
You must be signed in to change notification settings - Fork 7
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
Setting up tests with preact-cli project #52
Comments
I found the Nectarine project and used as example 🥇
Thanks! |
^ awesome! We're actually looking at shipping a Jest-based testing setup with preact-cli, and it would support both |
I may have a better config now, I will post a link to sample project and my config in this thread |
Here's my project, it's pre-CSS so the page doesn't look good yet, but it has Jest tests and preact-render-spy. It also uses Recompose, so it's got a fixture that helps test HOCs generated by that library. https://github.com/01binary/ultravest-assistant I think I found a good balance of testing state & mutators separately from state transforms and separately from UI:
|
Is there an article on setting this up with preact-cli created project? I have no doubt you are very busy so I will keep hacking, but if you know what's happening please let me know.
$ mocha --recursive --require babel-polyfill --compilers js:babel-register
Gets me:
I have some other tests that don't use JSX and work. I ended up putting babel "env" preset into my
package.json
because I go to extreme lengths to keep my package root clean, but doing the same with.babelrc
didn't make any difference. My package is customized from whatpreact-cli
did, in an attempt to get tests to work:I am confused because error message indicates it's getting transpiled through babylon but it's still unhappy.
The text was updated successfully, but these errors were encountered: