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

Commit 4fbd4bb

Browse files
committed
chore: update karma to 0.9.4
And also add shared config to make karma configs a bit simpler.
1 parent 2fae296 commit 4fbd4bb

6 files changed

+68
-46
lines changed

karma-e2e.conf.js

+18-15
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1-
var angularFiles = require(__dirname + '/angularFiles.js');
1+
var sharedConfig = require('./karma-shared.conf');
22

3-
files = [ANGULAR_SCENARIO, ANGULAR_SCENARIO_ADAPTER, 'build/docs/docs-scenario.js'];
3+
module.exports = function(config) {
4+
sharedConfig(config);
45

5-
autoWatch = false;
6-
singleRun = true;
7-
logLevel = LOG_INFO;
8-
logColors = true;
9-
browsers = ['Chrome'];
6+
config.set({
7+
frameworks: ['ng-scenario'],
8+
files: [
9+
'build/docs/docs-scenario.js'
10+
],
1011

11-
proxies = {
12-
// angular.js, angular-resource.js, etc
13-
'/angular': 'http://localhost:8000/build/angular',
14-
'/': 'http://localhost:8000/build/docs/'
15-
};
12+
proxies: {
13+
// angular.js, angular-resource.js, etc
14+
'/angular': 'http://localhost:8000/build/angular',
15+
'/': 'http://localhost:8000/build/docs/'
16+
},
1617

17-
junitReporter = {
18-
outputFile: 'test_out/e2e.xml',
19-
suite: 'E2E'
18+
junitReporter: {
19+
outputFile: 'test_out/e2e.xml',
20+
suite: 'E2E'
21+
}
22+
});
2023
};

karma-jqlite.conf.js

+12-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
var angularFiles = require(__dirname + '/angularFiles.js');
1+
var angularFiles = require('./angularFiles');
2+
var sharedConfig = require('./karma-shared.conf');
23

3-
files = angularFiles.mergeFiles(JASMINE, JASMINE_ADAPTER, 'jstd');
4-
exclude = ['**/*jasmine*/**', '**/*jstd*/**'].concat(angularFiles.files.jstdExclude);
4+
module.exports = function(config) {
5+
sharedConfig(config);
56

6-
autoWatch = true;
7-
logLevel = LOG_INFO;
8-
logColors = true;
9-
browsers = ['Chrome'];
7+
config.set({
8+
files: angularFiles.mergeFiles('jstd'),
9+
exclude: angularFiles.files.jstdExclude,
1010

11-
junitReporter = {
12-
outputFile: 'test_out/jqlite.xml',
13-
suite: 'jqLite'
11+
junitReporter: {
12+
outputFile: 'test_out/jqlite.xml',
13+
suite: 'jqLite'
14+
}
15+
});
1416
};

karma-jquery.conf.js

+12-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
var angularFiles = require(__dirname + '/angularFiles.js');
1+
var angularFiles = require('./angularFiles');
2+
var sharedConfig = require('./karma-shared.conf');
23

3-
files = angularFiles.mergeFiles(JASMINE, JASMINE_ADAPTER, 'jstdJquery');
4-
exclude = ['**/*jasmine*/**', '**/*jstd*/**'].concat(angularFiles.files.jstdJqueryExclude);
4+
module.exports = function(config) {
5+
sharedConfig(config);
56

6-
autoWatch = true;
7-
logLevel = LOG_INFO;
8-
logColors = true;
9-
browsers = ['Chrome'];
7+
config.set({
8+
files: angularFiles.mergeFiles('jstdJquery'),
9+
exclude: angularFiles.files.jstdJqueryExclude,
1010

11-
junitReporter = {
12-
outputFile: 'test_out/jquery.xml',
13-
suite: 'jQuery'
11+
junitReporter: {
12+
outputFile: 'test_out/jquery.xml',
13+
suite: 'jQuery'
14+
}
15+
});
1416
};

karma-modules.conf.js

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
var angularFiles = require(__dirname + '/angularFiles.js');
1+
var angularFiles = require('./angularFiles');
2+
var sharedConfig = require('./karma-shared.conf');
23

3-
files = angularFiles.mergeFiles(JASMINE, JASMINE_ADAPTER, 'jstdModules', 'angularSrcModules');
4-
exclude = ['**/*jasmine*/**', '**/*jstd*/**'];
4+
module.exports = function(config) {
5+
sharedConfig(config);
56

6-
autoWatch = true;
7-
logLevel = LOG_INFO;
8-
logColors = true;
9-
browsers = ['Chrome'];
7+
config.set({
8+
files: angularFiles.mergeFiles('jstdModules', 'angularSrcModules'),
109

11-
junitReporter = {
12-
outputFile: 'test_out/modules.xml',
13-
suite: 'modules'
10+
junitReporter: {
11+
outputFile: 'test_out/modules.xml',
12+
suite: 'modules'
13+
}
14+
});
1415
};

karma-shared.conf.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = function(config) {
2+
config.set({
3+
frameworks: ['jasmine'],
4+
autoWatch: true,
5+
logLevel: config.LOG_INFO,
6+
logColors: true,
7+
browsers: ['Chrome']
8+
});
9+
};

package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@
1414
"q-fs": "0.1.36",
1515
"qq": "0.3.5",
1616
"shelljs": "0.1.2",
17-
"karma": "0.8.4",
17+
"karma": "~0.9.4",
18+
"karma-jasmine": "~0.0.1",
19+
"karma-chrome-launcher": "~0.0.2",
20+
"karma-firefox-launcher": "~0.0.1",
21+
"karma-ng-scenario": "~0.0.1",
22+
"karma-junit-reporter": "~0.0.1",
1823
"yaml-js": "0.0.5",
1924
"showdown": "0.3.1"
2025
},

0 commit comments

Comments
 (0)