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

Commit 976edc1

Browse files
committed
chore: clean up angularFiles.js
1 parent 29f96c8 commit 976edc1

File tree

4 files changed

+24
-45
lines changed

4 files changed

+24
-45
lines changed

angularFiles.js

+19-40
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ angularFiles = {
114114
'test/ngMobile/**/*.js'
115115
],
116116

117-
'jstd': [
117+
'karma': [
118118
'components/jquery/jquery.js',
119119
'test/jquery_remove.js',
120120
'@angularSrc',
@@ -126,18 +126,18 @@ angularFiles = {
126126
'example/personalLog/test/*.js'
127127
],
128128

129-
'jstdExclude': [
129+
'karmaExclude': [
130130
'test/jquery_alias.js',
131131
'src/angular-bootstrap.js',
132132
'src/ngScenario/angular-bootstrap.js'
133133
],
134134

135-
'jstdScenario': [
135+
'karmaScenario': [
136136
'build/angular-scenario.js',
137137
'build/docs/docs-scenario.js'
138138
],
139139

140-
"jstdModules": [
140+
"karmaModules": [
141141
'build/angular.js',
142142
'@angularSrcModules',
143143
'src/ngScenario/browserTrigger.js',
@@ -151,21 +151,7 @@ angularFiles = {
151151
'test/ngMobile/**/*.js'
152152
],
153153

154-
'jstdPerf': [
155-
'@angularSrc',
156-
'@angularSrcModules',
157-
'src/ngMock/angular-mocks.js',
158-
'perf/data/*.js',
159-
'perf/testUtils.js',
160-
'perf/*.js'
161-
],
162-
163-
'jstdPerfExclude': [
164-
'src/ng/angular-bootstrap.js',
165-
'src/ngScenario/angular-bootstrap.js'
166-
],
167-
168-
'jstdJquery': [
154+
'karmaJquery': [
169155
'components/jquery/jquery.js',
170156
'test/jquery_alias.js',
171157
'@angularSrc',
@@ -178,37 +164,30 @@ angularFiles = {
178164
'example/personalLog/test/*.js'
179165
],
180166

181-
'jstdJqueryExclude': [
167+
'karmaJqueryExclude': [
182168
'src/angular-bootstrap.js',
183169
'src/ngScenario/angular-bootstrap.js',
184170
'test/jquery_remove.js'
185171
]
186172
};
187173

188174
if (exports) {
189-
exports.files = angularFiles
190-
exports.mergeFiles = function mergeFiles() {
175+
exports.files = angularFiles;
176+
exports.mergeFilesFor = function() {
191177
var files = [];
192178

193-
[].splice.call(arguments, 0).forEach(function(file) {
194-
if (file.match(/karma/)) {
195-
files.push(file);
196-
} else {
197-
angularFiles[file].forEach(function(f) {
198-
// replace @ref
199-
var match = f.match(/^\@(.*)/);
200-
if (match) {
201-
var deps = angularFiles[match[1]];
202-
files = files.concat(deps);
203-
} else {
204-
if (!/jstd|jasmine/.test(f)) { //TODO(i): remove once we don't have jstd/jasmine in repo
205-
files.push(f);
206-
}
207-
}
208-
});
209-
}
179+
Array.prototype.slice.call(arguments, 0).forEach(function(filegroup) {
180+
angularFiles[filegroup].forEach(function(file) {
181+
// replace @ref
182+
var match = file.match(/^\@(.*)/);
183+
if (match) {
184+
files = files.concat(angularFiles[match[1]]);
185+
} else {
186+
files.push(file);
187+
}
188+
});
210189
});
211190

212191
return files;
213-
}
192+
};
214193
}

karma-jqlite.conf.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ module.exports = function(config) {
55
sharedConfig(config);
66

77
config.set({
8-
files: angularFiles.mergeFiles('jstd'),
9-
exclude: angularFiles.files.jstdExclude,
8+
files: angularFiles.mergeFilesFor('karma'),
9+
exclude: angularFiles.mergeFilesFor('karmaExclude'),
1010

1111
junitReporter: {
1212
outputFile: 'test_out/jqlite.xml',

karma-jquery.conf.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ module.exports = function(config) {
55
sharedConfig(config);
66

77
config.set({
8-
files: angularFiles.mergeFiles('jstdJquery'),
9-
exclude: angularFiles.files.jstdJqueryExclude,
8+
files: angularFiles.mergeFilesFor('karmaJquery'),
9+
exclude: angularFiles.mergeFilesFor('karmaJqueryExclude'),
1010

1111
junitReporter: {
1212
outputFile: 'test_out/jquery.xml',

karma-modules.conf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = function(config) {
55
sharedConfig(config);
66

77
config.set({
8-
files: angularFiles.mergeFiles('jstdModules', 'angularSrcModules'),
8+
files: angularFiles.mergeFilesFor('karmaModules', 'angularSrcModules'),
99

1010
junitReporter: {
1111
outputFile: 'test_out/modules.xml',

0 commit comments

Comments
 (0)