I spoke at the JavaScript for WP conference about writing tests for the JavaScript code in our WordPress plugins. Talk was live online on July 10, 2020 at the. The code repository and the slides can be found here.
Just as JavaScript as become an integral part of WordPress, testing JavaScript is an integral part of development to ensure that our app do what’s it’s supposed to—and also that it doesn’t do how it’s not supposed to do.
The talk went through everything we need to setup and start testing JavaScript deeply:
wp_add_inline_script
and how to integrate them in our testsAll this offered a good understanding of why and how to start writing tests for JavaScript code in a WordPress theme or plugin.
#javascript #wordpress #jest #talk #unit testing