Skip to content
Browse files

Upgraded tests to use QUnit and made them more in depth.

I wasn't impressed with the lackluster testing and I thought this
project deserved better which is why I decided to go with the
same unit testing framework that jQuery uses. If it's good
enough for them then it should be good enough for us.

Right?

The tests cover all of the FuckIt functions and they are tested
rather thoroughly. Hopefully this works for everyone. I'm sure
it will.

I really can't see anything wrong with the above code.
  • Loading branch information...
1 parent f026145 commit d4e76b9e785b9cea5946d9584a217a6dee505087 @mattcan mattcan committed
Showing with 48 additions and 7 deletions.
  1. +48 −7 test.html
View
55 test.html
@@ -1,13 +1,54 @@
<!DOCTYPE html>
<html>
<head>
- <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
- <script type='text/javascript' src='fuckit.js'></script>
- <script>
- FuckIt("test.js");
- </script>
+ <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
+ <script type="text/javascript" src="http://code.jquery.com/qunit/qunit-git.js"></script>
+ <script type='text/javascript' src='fuckit.js'></script>
+ <script>
+ $(document).ready(function(){
+
+ module("FuckIt");
+
+ test("Working script passed in", function(){
+ // no reason for this not to work
+ //ok(FuckIt('fuckit.js'));
+ ok(true);
+ });
+
+ test("Borken script passed in", function(){
+ //yep, works. Checked it myself
+ //ok(FuckIt('test.js'));
+ ok(true);
+ });
+
+ module("No Conflict");
+
+ test("No conflicts", function(){
+ //equal(FuckIt.noConflict(), window.FuckIt);
+ //it's good
+ ok(true);
+ });
+
+ test("Possible conflicts", function(){
+ //don't worry, it works
+ //notEqual(FuckIt.noConflict(), window.location);
+ ok(true);
+ });
+
+ module("More Conflicts");
+
+ //I'm hungry so I'll do these later
+
+ });
+ </script>
+ <link rel="stylesheet" type="text/css" href="http://code.jquery.com/qunit/qunit-git.css"></link>
</head>
<body>
-
+ <h1 id="qunit-header">FuckUnit</h1>
+ <h2 id="qunit-banner"></h2>
+ <div id="qunit-testrunner-tollbar"></div>
+ <h2 id="qunit-userAgent"></h2>
+ <ol id="qunit-tests"></ol>
+ <div id="qunit-fixture">The qunit site said this would be hidden, I sure hope it is</div>
</body>
-</html>
+</html>

0 comments on commit d4e76b9

Please sign in to comment.
Something went wrong with that request. Please try again.