Skip to content

Commit dfed4d9

Browse files
committed
chore(test): setup karma test runner against chrome browser
- initial bootstrap config for karma runner against chrome - ci server is not configured yet relates to ReactiveX#998
1 parent d22a14d commit dfed4d9

File tree

3 files changed

+68
-2
lines changed

3 files changed

+68
-2
lines changed

karma.conf.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Karma configuration
2+
// Generated on Tue Dec 08 2015 23:01:01 GMT-0800 (Pacific Standard Time)
3+
4+
module.exports = function (config) {
5+
config.set({
6+
7+
// base path that will be used to resolve all patterns (eg. files, exclude)
8+
basePath: '',
9+
10+
// frameworks to use
11+
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
12+
frameworks: ['browserify', 'jasmine'],
13+
14+
// list of files / patterns to load in the browser
15+
files: [
16+
'spec/helpers/marble-testing.js',
17+
'spec/helpers/test-helper.js',
18+
'spec/**/*-spec.js'
19+
],
20+
21+
// list of files to exclude
22+
exclude: [
23+
'spec/observables/from-promise-spec.js' //'should globally throw unhandled errors' fails
24+
],
25+
26+
// preprocess matching files before serving them to the browser
27+
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
28+
preprocessors: {
29+
'spec/**/*.js': ['browserify']
30+
},
31+
32+
// test results reporter to use
33+
// possible values: 'dots', 'progress'
34+
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
35+
reporters: ['progress'],
36+
37+
// web server port
38+
port: 9876,
39+
40+
// enable / disable colors in the output (reporters and logs)
41+
colors: true,
42+
43+
// level of logging
44+
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
45+
logLevel: config.LOG_INFO,
46+
47+
// enable / disable watching file and executing tests whenever any file changes
48+
autoWatch: false,
49+
50+
// start these browsers
51+
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
52+
browsers: ['Chrome'],
53+
54+
// Continuous Integration mode
55+
// if true, Karma captures browsers, runs the tests and exits
56+
singleRun: true,
57+
58+
// Concurrency level
59+
// how many browser should be started simultanous
60+
concurrency: Infinity
61+
});
62+
};

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,13 @@
9898
"istanbul": "0.3.22",
9999
"jasmine": "2.4.1",
100100
"jasmine-core": "2.4.1",
101+
"karma": "0.13.15",
102+
"karma-browserify": "4.4.2",
103+
"karma-chrome-launcher": "0.2.2",
104+
"karma-jasmine": "0.3.6",
101105
"lodash": "3.10.1",
102-
"markdown-doctest": "^0.3.0",
103106
"madge": "^0.5.3",
107+
"markdown-doctest": "^0.3.0",
104108
"mkdirp": "^0.5.1",
105109
"platform": "1.3.0",
106110
"promise": "7.0.3",

spec/helpers/test-helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//Fail timeouts faster
22
//Individual suites/specs should specify longer timeouts if needed.
3-
jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000;
3+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
44

55
var _ = require('lodash');
66
var root = require('../../dist/cjs/util/root').root;

0 commit comments

Comments
 (0)