From e7621672f949240434bda026e4bbce295f2b890d Mon Sep 17 00:00:00 2001 From: Raul Ochoa <rochoaf@gmail.com> Date: Wed, 13 Jan 2016 10:21:57 +0100 Subject: [PATCH] Better naming for callback invocation counter --- test/image.test.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/test/image.test.js b/test/image.test.js index 94bd53e..97d4694 100644 --- a/test/image.test.js +++ b/test/image.test.js @@ -38,10 +38,10 @@ describe('Image', function () { it('test Image#onload multiple times', function() { var img = new Image - , n = 0; + , onloadCalled = 0; img.onload = function() { - ++n; + ++onloadCalled; }; img.src = png_checkers; @@ -56,14 +56,14 @@ describe('Image', function () { assert.strictEqual(320, img.width); assert.strictEqual(320, img.height); - assert.equal(n, 2); + assert.equal(onloadCalled, 2); - n = 0; + onloadCalled = 0; img.onload = function() { - ++n; + ++onloadCalled; }; img.src = png_clock; - assert.equal(n, 1); + assert.equal(onloadCalled, 1); }); it('Image#onerror', function () { @@ -98,7 +98,7 @@ describe('Image', function () { it('test Image#onerror multiple calls', function() { var img = new Image - , n = 0; + , onloadCalled = 0; img.onload = function() { @@ -106,7 +106,7 @@ describe('Image', function () { }; img.onerror = function() { - ++n; + ++onloadCalled; }; img.src = png_clock + 's1'; @@ -115,15 +115,15 @@ describe('Image', function () { img.src = png_clock + 's2'; assert.equal(img.src, png_clock + 's2'); - assert.equal(n, 2); + assert.equal(onloadCalled, 2); - n = 0; + onloadCalled = 0; img.onerror = function() { - ++n; + ++onloadCalled; }; img.src = png_clock + 's3'; assert.equal(img.src, png_clock + 's3'); - assert.equal(n, 1); + assert.equal(onloadCalled, 1); }); it('Image#{width,height}', function () {