HTML and CSS Reference
In-Depth Information
We now create a testing environment by creating a tests.html page within the
tests folder, and have the following code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tests for Sun n' Sand Festival
Code</title>
<link rel="stylesheet" href="qunit-1.9.0.css">
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script src="//ajax.googleapis.com/ajax/libs/
jquery/1.7.2/jquery.min.js"></script>
<script>window.jQuery ||
document.write('<script src="js/vendor/
jquery-1.7.2.min.js"><\/script>')</script>
<script src="qunit-1.9.0.js"></script>
<script src="../js/main.js"></script>
<script src="test.js"></script>
</body>
</html>
In this code, we have included our main.js , file that we are using on our website.
We will be testing the code we wrote for the tabs used to display the line up.
Now, we will create the test.js file, where we will write all our tests for our code.
As our test depends on the markup that is used for the tabs, let us copy the markup
without the content from index.html to tests.html .
If we execute this test as it is, we will get an error claiming global failure. If you open
up the console of your browser's developer tools, you should see the following error:
Search WWH ::




Custom Search