diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/InjectorSpec.js | 23 | ||||
| -rw-r--r-- | test/loaderSpec.js | 2 |
2 files changed, 25 insertions, 0 deletions
diff --git a/test/InjectorSpec.js b/test/InjectorSpec.js index e0cabbac..2ea5b66d 100644 --- a/test/InjectorSpec.js +++ b/test/InjectorSpec.js @@ -260,6 +260,29 @@ describe('injector', function() { }); describe('$provide', function() { + describe('constant', function() { + it('should create configuration injectable constants', function() { + var log = []; + createInjector([ + function($provide){ + $provide.constant('abc', 123); + $provide.constant({a: 'A', b:'B'}); + return function(a) { + log.push(a); + } + }, + function(abc) { + log.push(abc); + return function(b) { + log.push(b); + } + } + ]).get('abc'); + expect(log).toEqual([123, 'A', 'B']); + }); + }); + + describe('value', function() { it('should configure $provide values', function() { expect(createInjector([function($provide) { diff --git a/test/loaderSpec.js b/test/loaderSpec.js index f983c08b..5d234b6d 100644 --- a/test/loaderSpec.js +++ b/test/loaderSpec.js @@ -38,10 +38,12 @@ describe('module loader', function() { filter('f', 'ff'). directive('d', 'dd'). config('init2'). + constant('abc', 123). run('runBlock')).toBe(myModule); expect(myModule.requires).toEqual(['other']); expect(myModule._invokeQueue).toEqual([ + ['$provide', 'constant', ['abc', 123] ], ['$injector', 'invoke', ['config'] ], ['$provide', 'service', ['sk', 'sv'] ], ['$provide', 'factory', ['fk', 'fv'] ], |
