Posted in JavaScript

QUnit introduce


  • What is QUnit?

QUnit is a powerful, easy-to-use JavaScript unit testing framework. It’s used by the jQuery, jQuery UI and jQuery Mobile projects and is capable of testing any generic JavaScript code.

Refer: QUnit site

  • Install QUnit using NPM:

npm install -g qunit

  • Hello World Demo:


<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>QUnit Example</title>
<link rel="stylesheet" href="">
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script src=""></script>
<script src="tests.js"></script>


QUnit.test( "hello test", function( assert ) {
assert.ok( 1 == "1", "Passed!" );


Simply run Demo by open index.html file in Brower. Refer:


You also file the demo at HelloWorld at Github

Thank you. Hope it is useful 🙂


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s