This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Simplified unit tests and added warning being thrown by lint to its i…

…gnore list
  • Loading branch information...
dseif committed Sep 14, 2011
1 parent e01aea8 commit 3e7e6d071cbe31914692baf6988a3c16da38df88
Showing with 9 additions and 16 deletions.
  1. +2 −1 build/jslint-check.js
  2. +7 −15 test/popcorn.unit.js
View
@@ -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)
View
@@ -2582,35 +2582,27 @@ 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 );
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();
});

0 comments on commit 3e7e6d0

Please sign in to comment.