Permalink
Browse files

subtle improvement to unit test

  • Loading branch information...
1 parent 0f7e092 commit ae9b2a9c0ef811d9920ebea300ad9a456316688e @hughfdjackson committed Dec 18, 2011
Showing with 9 additions and 3 deletions.
  1. +5 −3 src-test/spec/load_images_spec.js
  2. +4 −0 src/load_images.js
@@ -5,14 +5,16 @@ describe("load_images", function(){
'person': '../images/person.png',
'ninja': '../images/ninja.png'
},
- images = {}
+ images = {},
+ flag = false
load_images(to_load, function(i){
images = i
+ flag = true
})
-
+
waitsFor(function(){
- return images.person && images.ninja
+ return flag
}, "images to load", 5000)
runs(function(){
View
@@ -9,6 +9,10 @@ function load_images(image_object, callback){
to_load -= 1
if ( to_load == 0 && callback ) callback(images)
}
+
+ function on_error(){
+
+ }
function load(key, val){
var image = new Image()

0 comments on commit ae9b2a9

Please sign in to comment.