/
karma.conf.js
62 lines (53 loc) · 1.83 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
'use strict';
if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) {
throw new Error('No SauceLabs credentials set. ' +
'Please set SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables ' +
'and run test again');
}
const customLaunchers = require('./tests/browsers');
module.exports = function (config) {
// @see https://github.com/karma-runner/karma-sauce-launcher/issues/73
const sauceLabsStartConnect = process.env.TRAVIS ? false : true;
const configuration = {
frameworks: ['jasmine'],
files: [
'node_modules/promise-polyfill/promise.js', // ie11 support
'dist/sklad.uncompressed.js',
'tests/test_utils.js',
'tests/interface.js',
'tests/open.js',
'tests/open_blocked_evt.js',
'tests/migration_context.js',
'tests/delete_database.js',
'tests/close.js',
'tests/insert.js',
'tests/upsert.js',
'tests/delete.js',
'tests/clear.js',
'tests/count.js',
'tests/get.js'
],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
reporters: ['mocha', 'saucelabs'],
plugins: [
'karma-jasmine',
'karma-mocha-reporter',
'karma-sauce-launcher'
],
sauceLabs: {
startConnect: sauceLabsStartConnect,
testName: 'Sklad Unit Tests',
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
tags: ['indexeddb', 'clientside']
},
captureTimeout: 300000,
browserDisconnectTimeout: 20000,
browserNoActivityTimeout: 300000,
customLaunchers: customLaunchers,
browsers: Object.keys(customLaunchers)
};
config.set(configuration);
};