diff --git a/test/color-finderSpec.js b/test/color-finderSpec.js index bd59b5b..a3f4d46 100644 --- a/test/color-finderSpec.js +++ b/test/color-finderSpec.js @@ -43,13 +43,25 @@ describe('ColorFinder Class', function () { }).toThrow(Error('ColorFinder: fromImage: Invalid callback')); }); - // TODO This test fails on Travis environment - /*it('should proceed and call function with color', function (done) { + it('should proceed and call function with color', function (done) { expect(ColorFinder.fromImage(DEMO_IMAGE, function (color) { - expect(color).toEqual([179, 165, 103]); + expect(color instanceof Array).toBeTruthy(); + + expect(color.length).toBe(3); + + // expect(color).toEqual([179, 165, 103]); // TODO This assertion fails on Travis environment + expect(color[0]).toBeGreaterThan(178); + expect(color[0]).toBeLessThan(191); + + expect(color[1]).toBeGreaterThan(164); + expect(color[1]).toBeLessThan(177); + + expect(color[2]).toBeGreaterThan(102); + expect(color[2]).toBeLessThan(122); + done(); })).toBe(ColorFinder); - });*/ + }); });