]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
Simplified unit tests and added warning being thrown by lint to its ignore list
authorDavid Seifried <david.c.seifried@gmail.com>
Wed, 14 Sep 2011 16:18:17 +0000 (12:18 -0400)
committerDavid Seifried <david.c.seifried@gmail.com>
Wed, 14 Sep 2011 16:18:17 +0000 (12:18 -0400)
build/jslint-check.js
test/popcorn.unit.js

index 335efc78a603acb0a6cae4ce78e3e7eb875a70ca..6a97e4a8abccceb0ab941a89a640288d54ef3d57 100644 (file)
@@ -10,7 +10,8 @@ var ok = {
   "Expected an assignment or function call and instead saw an expression.": true,
   "Expected a 'break' statement before 'case'.": true,
   "'e' is already defined.": true,
-  "Don't make functions within a loop.": true
+  "Don't make functions within a loop.": true,
+  "['out'] is better written in dot notation.": true
 };
 
 function check(src)
index f3fd67a2154be45d08445e54b0b490f710db593c..e448b27170d6628dad0cc1c1d08e772afb66df0c 100644 (file)
@@ -2582,9 +2582,7 @@ test( "In/Out aliases", function() {
   var popcorn = Popcorn( "#video" ),
       expects = 3,
       count = 0,
-      aliasDiv = document.createElement( "div" );
-      
-  document.body.appendChild( aliasDiv );
+      counter = 0; 
 
   expect( expects );
   stop( 5000 );
@@ -2592,25 +2590,19 @@ test( "In/Out aliases", function() {
   function plus() {
     if ( ++count === expects ) {
       Popcorn.removePlugin( "aliasTester" );
-      document.body.removeChild( aliasDiv );
+      Popcorn.removeInstance( popcorn );
       start();
     }
   }
 
-  aliasDiv.id = "aliasDiv";
-
   Popcorn.plugin( "aliasTester", function() {
 
     return {
       start: function() {
-        var div = document.getElementById( "aliasDiv" );
-        div.style.display = "inline";
-        div.innerHTML = "Showing";       
+        counter++;
       },
       end: function() {
-        var div = document.getElementById( "aliasDiv" );
-        div.innerHTML = "";
-        div.style.display = "none";   
+        counter++;
       }
     };
   });
@@ -2622,16 +2614,16 @@ test( "In/Out aliases", function() {
 
   popcorn.currentTime( 0 ).pause();
 
-  equals( aliasDiv.innerHTML, "", "Container is initially empty" );
+  equals( counter, 0, "Container is initially empty" );
   plus();
 
   popcorn.exec( 2, function() {
-    equals( aliasDiv.innerHTML, "Showing", "Container is displaying 'Showing', in alias is working" );
+    equals( counter, 1, "Container is displaying 'Showing', in alias is working" );
     plus();
   });
 
   popcorn.exec( 4, function() {
-    equals( aliasDiv.innerHTML, "", "Container is displaying nothing again, out alias is working" );
+    equals( counter, 2, "Container is displaying nothing again, out alias is working" );
     plus();
   });