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

Commit 8efcec6

Browse files
committed
chore: clean up angularFiles.js
1 parent 4fbd4bb commit 8efcec6

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
@@ -108,7 +108,7 @@ angularFiles = {
108108
'test/ngMock/*.js'
109109
],
110110

111-
'jstd': [
111+
'karma': [
112112
'lib/jquery/jquery.js',
113113
'test/jquery_remove.js',
114114
'@angularSrc',
@@ -120,18 +120,18 @@ angularFiles = {
120120
'example/personalLog/test/*.js'
121121
],
122122

123-
'jstdExclude': [
123+
'karmaExclude': [
124124
'test/jquery_alias.js',
125125
'src/angular-bootstrap.js',
126126
'src/ngScenario/angular-bootstrap.js'
127127
],
128128

129-
'jstdScenario': [
129+
'karmaScenario': [
130130
'build/angular-scenario.js',
131131
'build/docs/docs-scenario.js'
132132
],
133133

134-
"jstdModules": [
134+
"karmaModules": [
135135
'build/angular.js',
136136
'src/ngMock/angular-mocks.js',
137137
'src/ngCookies/cookies.js',
@@ -148,21 +148,7 @@ angularFiles = {
148148
'test/ngSanitize/filter/*.js'
149149
],
150150

151-
'jstdPerf': [
152-
'@angularSrc',
153-
'@angularSrcModules',
154-
'src/ngMock/angular-mocks.js',
155-
'perf/data/*.js',
156-
'perf/testUtils.js',
157-
'perf/*.js'
158-
],
159-
160-
'jstdPerfExclude': [
161-
'src/ng/angular-bootstrap.js',
162-
'src/ngScenario/angular-bootstrap.js'
163-
],
164-
165-
'jstdJquery': [
151+
'karmaJquery': [
166152
'lib/jquery/jquery.js',
167153
'test/jquery_alias.js',
168154
'@angularSrc',
@@ -175,37 +161,30 @@ angularFiles = {
175161
'example/personalLog/test/*.js'
176162
],
177163

178-
'jstdJqueryExclude': [
164+
'karmaJqueryExclude': [
179165
'src/angular-bootstrap.js',
180166
'src/ngScenario/angular-bootstrap.js',
181167
'test/jquery_remove.js'
182168
]
183169
};
184170

185171
if (exports) {
186-
exports.files = angularFiles
187-
exports.mergeFiles = function mergeFiles() {
172+
exports.files = angularFiles;
173+
exports.mergeFilesFor = function() {
188174
var files = [];
189175

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

209188
return files;
210-
}
189+
};
211190
}

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)