From 7c1b5ec5989f1c9c7609c81149ead3b3f75e4894 Mon Sep 17 00:00:00 2001 From: Patrick Date: Wed, 20 May 2015 20:13:32 +0200 Subject: [PATCH] fix(tests): fix the exception comparison for non enabled recognizers --- test/gestures.Spec.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/test/gestures.Spec.js b/test/gestures.Spec.js index ba8f50d..414dc1c 100644 --- a/test/gestures.Spec.js +++ b/test/gestures.Spec.js @@ -1,10 +1,12 @@ -describe("A suite", function() { - it("contains spec with an expectation", function() { +'use strict'; + +describe('A suite', function() { + it('contains spec with an expectation', function() { expect(true).toBe(true); }); }); -describe("Gesture recognizers validation", function() { +describe('Gesture recognizers validation', function() { var $compile, $rootScope; @@ -28,32 +30,32 @@ describe("Gesture recognizers validation", function() { $rootScope = _$rootScope_; })); - it("should throw if no swipe recognizer is not configured and hmSwipe directive is used", function() { + it('should throw if no swipe recognizer is not configured and hmSwipe directive is used', function() { expect(function() { var element = $compile("
")($rootScope); $rootScope.$digest(); - }).toThrow("Directive hmSwipe requires gesture recognizer [Hammer.Swipe] to be enabled"); + }).toThrow(new Error('Directive hmSwipe requires gesture recognizer [Hammer.Swipe] to be enabled')); }); - it("should not throw if tap recognizer is configured and hmTap directive is used", function() { + it('should not throw if tap recognizer is configured and hmTap directive is used', function() { var element = $compile("
")($rootScope); $rootScope.$digest(); }); - it("should throw if pinch recognizer is configured but disabled and hmPinch directive is used", function() { + it('should throw if pinch recognizer is configured but disabled and hmPinch directive is used', function() { expect(function() { var element = $compile("
")($rootScope); $rootScope.$digest(); - }).toThrow("Directive hmPinch requires gesture recognizer [Hammer.Pinch] to be enabled"); + }).toThrow(new Error('Directive hmPinch requires gesture recognizer [Hammer.Pinch] to be enabled')); }); - it("should not throw if rotate recognizer is configured and explicitly enabled and hmRotate directive is used", function() { - var element = $compile("
")($rootScope); + it('should not throw if rotate recognizer is configured and explicitly enabled and hmRotate directive is used', function() { + var element = $compile('
')($rootScope); $rootScope.$digest(); }); - it("should not throw if hmTouch directive is used (no recognizer needed)", function() { - var element = $compile("
")($rootScope); + it('should not throw if hmTouch directive is used (no recognizer needed)', function() { + var element = $compile('
')($rootScope); $rootScope.$digest(); }); }); \ No newline at end of file