Skip to content
This repository has been archived by the owner on Jun 29, 2018. It is now read-only.

Commit

Permalink
Simplified unit tests and added warning being thrown by lint to its i…
Browse files Browse the repository at this point in the history
…gnore list
  • Loading branch information
dseif committed Sep 14, 2011
1 parent e01aea8 commit 3e7e6d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
3 changes: 2 additions & 1 deletion build/jslint-check.js
Expand Up @@ -10,7 +10,8 @@ var ok = {
"Expected an assignment or function call and instead saw an expression.": true, "Expected an assignment or function call and instead saw an expression.": true,
"Expected a 'break' statement before 'case'.": true, "Expected a 'break' statement before 'case'.": true,
"'e' is already defined.": 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) function check(src)
Expand Down
22 changes: 7 additions & 15 deletions test/popcorn.unit.js
Expand Up @@ -2582,35 +2582,27 @@ test( "In/Out aliases", function() {
var popcorn = Popcorn( "#video" ), var popcorn = Popcorn( "#video" ),
expects = 3, expects = 3,
count = 0, count = 0,
aliasDiv = document.createElement( "div" ); counter = 0;

document.body.appendChild( aliasDiv );


expect( expects ); expect( expects );
stop( 5000 ); stop( 5000 );


function plus() { function plus() {
if ( ++count === expects ) { if ( ++count === expects ) {
Popcorn.removePlugin( "aliasTester" ); Popcorn.removePlugin( "aliasTester" );
document.body.removeChild( aliasDiv ); Popcorn.removeInstance( popcorn );
start(); start();
} }
} }


aliasDiv.id = "aliasDiv";

Popcorn.plugin( "aliasTester", function() { Popcorn.plugin( "aliasTester", function() {


return { return {
start: function() { start: function() {
var div = document.getElementById( "aliasDiv" ); counter++;
div.style.display = "inline";
div.innerHTML = "Showing";
}, },
end: function() { end: function() {
var div = document.getElementById( "aliasDiv" ); counter++;
div.innerHTML = "";
div.style.display = "none";
} }
}; };
}); });
Expand All @@ -2622,16 +2614,16 @@ test( "In/Out aliases", function() {


popcorn.currentTime( 0 ).pause(); popcorn.currentTime( 0 ).pause();


equals( aliasDiv.innerHTML, "", "Container is initially empty" ); equals( counter, 0, "Container is initially empty" );
plus(); plus();


popcorn.exec( 2, function() { 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(); plus();
}); });


popcorn.exec( 4, function() { 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(); plus();
}); });


Expand Down

0 comments on commit 3e7e6d0

Please sign in to comment.