From cca86886f1ed3c29f79974909563635e8358f336 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Sun, 3 Jan 2016 11:37:29 -0700 Subject: [PATCH] Define variables before use --- test/spec/ol/source/imagestaticsource.test.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/spec/ol/source/imagestaticsource.test.js b/test/spec/ol/source/imagestaticsource.test.js index 6278f7b435..1d5cf2461f 100644 --- a/test/spec/ol/source/imagestaticsource.test.js +++ b/test/spec/ol/source/imagestaticsource.test.js @@ -23,13 +23,14 @@ describe('ol.source.ImageStatic', function() { projection: projection }); + var image = source.getImage(extent, resolution, pixelRatio, projection); + source.on('imageloadend', function(event) { expect(image.getImage().width).to.be(128); expect(image.getImage().height).to.be(256); done(); }); - var image = source.getImage(extent, resolution, pixelRatio, projection); image.load(); }); @@ -43,13 +44,14 @@ describe('ol.source.ImageStatic', function() { projection: projection }); + var image = source.getImage(extent, resolution, pixelRatio, projection); + source.on('imageloadend', function(event) { expect(image.getImage().width).to.be(127); expect(image.getImage().height).to.be(254); done(); }); - var image = source.getImage(extent, resolution, pixelRatio, projection); image.load(); });