JavaScript: QUnit

QUnit is a JavaScriptJavaScript JavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser. https://www.javascript.com/. unit testing framework.

 

Installation

1. Set up your install. Follow one of the guides to setup your local installLocal Install A local install of WordPress is a way to create a staging environment by installing a LAMP or LEMP stack on your local computer. https://make.wordpress.org/core/handbook/tutorials/installing-wordpress-locally/.

2. Install WordPress via SVNSVN Subversion, the popular version control system (VCS) by the Apache project, used by WordPress to manage changes to its codebase. Install WordPress via SVN or GitGit Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Git is easy to learn and has a tiny footprint with lightning fast performance. Most modern plugin and theme development is being done with this version control system. https://git-scm.com/. https://make.wordpress.org/core/handbook/tutorials/installing-wordpress-locally/from-svn/.

Top ↑

Running the QUnit Test Suite

From your now installed and configured WordPress testing installation navigate to /tests/qunit/index.html.

If your locally setup domain is http://wp-test.dev then http://wp-test.dev/tests/qunit/index.html is the URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org you want.

You can also run the tests directly in the browser without setting up a web server, append /tests/qunit/index.html to the the file path of your repo check out, for example file:///Users/myusername/dev/develop.svn.wordpress.org/trunk/tests/qunit/index.html

Last updated: