-
Notifications
You must be signed in to change notification settings - Fork 313
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
Include examples of tests #26
Comments
I'm new to JS testing and this would be extremely helpful. There is very little documentation about setting up the test environment for custom blocks. From the few plugins that have it set up it's not entirely clear how it was done (and if it was done correctly). |
|
Related wp-cli/ideas#103 |
This is still relevant. I am having trouble getting Jest to run with wp-scripts, see today's discussion on Slack: https://wordpress.slack.com/archives/C02QB2JS7/p1556031641343900. |
I started a repo in order to try and get a minimal example working. https://github.com/iandunn/wp-scripts-test-example I forked https://github.com/eventespresso/event-espresso-core (props @nerrad) and started removing everything that wasn't absolutely necessary for unit tests. it'd be nice to add e2e as well, but so far i've only had time for unit. It's working, but still requires a lot of stuff that seems like cc @gziolo in case you have any insight into what (if anything) |
Now that I nearly finished adding support for I hope I can identify all the issues we have at the moment when working outside of Gutenberg. I anticipate we might want to be more strict about pattern matching for both types of tests. This should make documenting easier and further usage less confusing. |
That would be extremely helpful, thank you! |
As another example for people, @ryelle got unit tests working for WordCamp.org in WordPress/wordcamp.org#211. |
I opened #84 to perform my own explorations and identified a few places where we can improve WordPress packages to make it more seamless. |
Tests are located in: It had some further iterations and it works well now. |
I've found it time consuming to get Jest properly configured with Babel and JSX and all the things. I think it'd be useful to include working testings and all the required build tool configs, in order to make this easier and more convenient for people.
The text was updated successfully, but these errors were encountered: