From 80341cb9badd952fdc80094df4123629313b4cc4 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Wed, 1 May 2013 20:55:25 -0400 Subject: feat(injector): add has method for querying Closes #2556 --- test/auto/injectorSpec.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/auto') diff --git a/test/auto/injectorSpec.js b/test/auto/injectorSpec.js index 6f84897b..8fd03be4 100644 --- a/test/auto/injectorSpec.js +++ b/test/auto/injectorSpec.js @@ -58,6 +58,15 @@ describe('injector', function() { }); + it('should allow query names', function() { + providers('abc', function () { return ''; }); + + expect(injector.has('abc')).toBe(true); + expect(injector.has('xyz')).toBe(false); + expect(injector.has('$injector')).toBe(true); + }); + + it('should provide useful message if no provider', function() { expect(function() { injector.get('idontexist'); -- cgit v1.2.3