forked from rollbar/rollbar.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
95 lines (77 loc) · 2.27 KB
/
karma.conf.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
var path = require('path');
var webpack = require('webpack');
var defaults = require('./defaults');
var browserStackBrowsers = require('./browserstack.browsers');
var defaultsPlugin = new webpack.DefinePlugin(defaults);
var allBrowsers = browserStackBrowsers.filter('bs_all');
var allBrowsersByBrowser = {};
allBrowsers.forEach(function(browser) {
allBrowsersByBrowser[browser._alias] = browser;
});
module.exports = function (config) {
config.set({
browsers: ['PhantomJS'],
// The Travis environment has these specified.
// To run BrowserStack tests locally, specify the environment variables:
// BROWSER_STACK_USERNAME, BROWSER_STACK_ACCESS_KEY
browserStack: {
username: null,
accessKey: null
},
client: {
captureConsole: true
},
// Used for testing on BrowserStack
customLaunchers: allBrowsersByBrowser,
// Files are specified in the grunt-karma configuration in Gruntfile.js
//files: []
frameworks: ['mocha', 'expect', 'sinon', 'jquery-1.9.0'],
logLevel: 'INFO',
// Default is 1000 but we can run into rate limit issues so bump it up to 10k
pollingTimeout: 10000,
// run the bundle through the webpack and sourcemap plugins
preprocessors: {
'test/!(requirejs).test.js': ['webpack', 'sourcemap'],
},
proxies: {
'/dist/rollbar.js': '/base/dist/rollbar.js'
},
reporters: ['progress'],
singleRun: true,
// Use "polling" and JSONP for older browsers
transports: ['polling'],
forceJSONP: true,
webpack: {
eslint: {
configFile: path.resolve(__dirname, ".eslintrc")
},
plugins: [defaultsPlugin],
devtool: 'inline-source-map',
module: {
preLoaders: [
{
test: /\.js$/,
loader: "strict!eslint",
exclude: [/node_modules/, /vendor/, /lib/, /dist/]
}
],
loaders: [
{
test: /(mootootls|requirejs)\.js$/,
loader: 'script'
}
],
postLoaders: [
{
test: /\.js$/,
exclude: [/node_modules/, /vendor/, /lib/, /dist/, /test/],
loader: 'istanbul-instrumenter'
}
]
}
},
webpackMiddleware: {
noInfo: true
}
});
};