Testing WordPress Blocks

The previous section of this site introduced testing for React apps. WordPress' block editor is a React app. In general, we use the same tools to test, compile and lint blocks as any other React code -- Jest, Babel, webpack, etc.

Setting up all of that in a WordPress project, historically was a pain. The new @wordpress/scripts abstracts away the complexity of using these tools with WordPress.

Remember, everything you know about React testing applies to testing blocks.

Example Code Part Two