forked from APIDevTools/swagger-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkarma.conf.js
More file actions
63 lines (55 loc) · 1.81 KB
/
karma.conf.js
File metadata and controls
63 lines (55 loc) · 1.81 KB
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
module.exports = function(config) {
'use strict';
var isMac = /^darwin/.test(process.platform),
isWindows = /^win/.test(process.platform),
isLinux = !(isMac || isWindows),
isTravisCI = process.env.TRAVIS === 'true';
// Basic Karma configuration
var cfg = {
port: 9876,
browserNoActivityTimeout: 8000,
colors: true,
logLevel: config.LOG_INFO,
frameworks: ['mocha', 'chai', 'sinon'],
reporters: ['mocha'],
files: [
// Swagger-Parser
'dist/swagger-parser.min.js',
{pattern: 'dist/swagger-parser.js.map', included: false},
// Test environment
'tests/test-environment.js',
'tests/files/real-world/file-list.js',
'tests/files/good/text-resolved.js',
'tests/files/good/image-resolved.js',
'tests/files/**/*-resolved.js',
'tests/files/**/*-dereferenced.js',
'tests/files/**/*-dereferenced-external.js',
{pattern: 'tests/files/**', included: false},
// Unit tests
'tests/specs/**/*-spec.js'
],
browsers: (function() {
// Test on all browsers that are available for the environment
if (isMac) {
return ['PhantomJS', 'Firefox', 'Chrome', 'Safari'];
}
else if (isWindows) {
return ['PhantomJS', 'Firefox', 'Chrome', 'Safari', 'IE'];
}
else if (isTravisCI) {
return ['PhantomJS', 'Firefox'];
}
else if (isLinux) {
return ['PhantomJS', 'Firefox', 'Chrome'];
}
})()
};
if (isTravisCI || isWindows) {
cfg.exclude = [
// Skip the 100+ Swagger Files when running IN A BROWSER on Travis or Windows because they both choke.
// NOTE: We DO still run these 100+ tests IN NODE on these platforms. Just not in the browser.
'tests/files/real-world/file-list.js'
];
}
config.set(cfg);
};