Skip to content

Instantly share code, notes, and snippets.

@pawelpabich
Created October 30, 2012 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pawelpabich/3979072 to your computer and use it in GitHub Desktop.
Save pawelpabich/3979072 to your computer and use it in GitHub Desktop.
Java Script unit testing with YUI Test and Jack mocking framework
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title></title>
<script src="Scripts/Form.js" type="text/javascript"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"> </script>
</head>
<body>
<form method="post" action="">
<p>Why did you decided to submit this form?</p>
<fieldset><legend>Reasons</legend>
<ul>
<li>
<label for="dontKnowReason">I don't know: </label>
<input type="checkbox" name="dontKnowReason" id="dontKnowReason" />
</li>
<li>
<label for="likeTheFormReason">I like the form: </label>
<input type="checkbox" name="likeTheFormReason" id="likeTheFormReason" />
</li>
<li>
<label for="wasToldReason">Someone told me to do so: </label>
<input type="checkbox" name="wasToldReason" id="wasToldReason" />
</li>
<li>
<label for="customReason">Other reason: </label>
<input type="text" name="customReason" id="customReason" />
</li>
</ul>
</fieldset>
<input type="submit" value="Submit" />
</form>
<script type="text/javascript"> $(function () { JSUnitTesting.init(); }); </script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment