Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…gnore list
  • Loading branch information...
commit 3e7e6d071cbe31914692baf6988a3c16da38df88 1 parent e01aea8
@dseif dseif authored
Showing with 9 additions and 16 deletions.
  1. +2 −1  build/jslint-check.js
  2. +7 −15 test/popcorn.unit.js
View
3  build/jslint-check.js
@@ -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
22 test/popcorn.unit.js
@@ -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();
});
Please sign in to comment.
Something went wrong with that request. Please try again.