From 83ac38d261bac2dc2449107384bc14373280db03 Mon Sep 17 00:00:00 2001 From: gonengar Date: Tue, 24 Mar 2015 19:09:34 +0100 Subject: [PATCH] docs(guide/Unit Testing): fixing the example for testing fiflter. Hi there, It seems that in the example which starts at line 256 there need to be an injection for $filter as in the previous example. --- docs/content/guide/unit-testing.ngdoc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/content/guide/unit-testing.ngdoc b/docs/content/guide/unit-testing.ngdoc index 8f811e3e87cd..90865a77f921 100644 --- a/docs/content/guide/unit-testing.ngdoc +++ b/docs/content/guide/unit-testing.ngdoc @@ -260,12 +260,20 @@ myModule.filter('length', function() { }); describe('length filter', function() { + + beforeEach(inject(function(_$filter_){ + $filter= _$filter_; + })); + it('returns 0 when given null', function() { var length = $filter('length'); expect(length(null)).toEqual(0); }); it('returns the correct value when given a string of chars', function() { + beforeEach(inject(function(_$filter_){ + $filter= _$filter_; + })); var length = $filter('length'); expect(length('abc')).toEqual(3); });