Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 711f06a

Browse files
committed
fixup! chore: properly isolate module tests
1 parent 86d916a commit 711f06a

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

angularFiles.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ var angularFiles = {
191191

192192
'karmaModulesBase': [
193193
'build/angular.js',
194-
'src/ngMock/*.js',
194+
'build/angular-mocks.js',
195195
'test/modules/no_bootstrap.js',
196196
'test/helpers/matchers.js',
197197
'test/helpers/privateMocks.js',
@@ -230,9 +230,15 @@ var angularFiles = {
230230
'test/ngMessages/**/*.js'
231231
],
232232

233+
// ngMock doesn't include the base because it must use the ngMock src files
233234
'karmaModules-ngMock': [
234-
'@karmaModulesBase',
235-
'build/angular-resource.js',
235+
'build/angular.js',
236+
'src/ngMock/*.js',
237+
'test/modules/no_bootstrap.js',
238+
'test/helpers/matchers.js',
239+
'test/helpers/privateMocks.js',
240+
'test/helpers/support.js',
241+
'test/helpers/testabilityPatch.js',
236242
'src/routeToRegExp.js',
237243
'build/angular-animate.js',
238244
'test/ngMock/**/*.js'

test/ngMock/angular-mocksSpec.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -1109,11 +1109,13 @@ describe('ngMock', function() {
11091109
var mock = { log: 'module' };
11101110

11111111
beforeEach(function() {
1112+
angular.module('stringRefModule', []).service('stringRef', function() {});
1113+
11121114
module({
11131115
'service': mock,
11141116
'other': { some: 'replacement'}
11151117
},
1116-
'ngResource',
1118+
'stringRefModule',
11171119
function($provide) { $provide.value('example', 'win'); }
11181120
);
11191121
});
@@ -1132,9 +1134,9 @@ describe('ngMock', function() {
11321134
});
11331135

11341136
it('should integrate with string and function', function() {
1135-
inject(function(service, $resource, example) {
1137+
inject(function(service, stringRef, example) {
11361138
expect(service).toEqual(mock);
1137-
expect($resource).toBeDefined();
1139+
expect(stringRef).toBeDefined();
11381140
expect(example).toEqual('win');
11391141
});
11401142
});

0 commit comments

Comments
 (0)