|
| 1 | +const browsers = { |
| 2 | + sl_chrome: { |
| 3 | + base: 'SauceLabs', |
| 4 | + browserName: 'chrome', |
| 5 | + platform: 'Windows 10', |
| 6 | + version: '53' |
| 7 | + }, |
| 8 | + sl_firefox: { |
| 9 | + base: 'SauceLabs', |
| 10 | + browserName: 'firefox', |
| 11 | + version: '49' |
| 12 | + }, |
| 13 | + sl_ios_safari: { |
| 14 | + base: 'SauceLabs', |
| 15 | + browserName: 'iphone', |
| 16 | + platform: 'OS X 10.9', |
| 17 | + version: '7.1' |
| 18 | + }, |
| 19 | + sl_ie_11: { |
| 20 | + base: 'SauceLabs', |
| 21 | + browserName: 'internet explorer', |
| 22 | + platform: 'Windows 10', |
| 23 | + version: '11' |
| 24 | + } |
| 25 | +} |
| 26 | + |
| 27 | +module.exports = (config) => { |
| 28 | + config.set({ |
| 29 | + |
| 30 | + // base path that will be used to resolve all patterns (eg. files, exclude) |
| 31 | + basePath: '', |
| 32 | + |
| 33 | + // frameworks to use |
| 34 | + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter |
| 35 | + frameworks: ['jasmine'], |
| 36 | + |
| 37 | + // list of files / patterns to load in the browser |
| 38 | + files: [ |
| 39 | + 'jspdf.js', { |
| 40 | + pattern: 'specs/**/*.spec.js', |
| 41 | + included: true |
| 42 | + } |
| 43 | + ], |
| 44 | + |
| 45 | + // list of files to exclude |
| 46 | + exclude: [], |
| 47 | + |
| 48 | + // preprocess matching files before serving them to the browser |
| 49 | + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor |
| 50 | + preprocessors: {}, |
| 51 | + |
| 52 | + // test results reporter to use |
| 53 | + // possible values: 'dots', 'progress' |
| 54 | + // available reporters: https://npmjs.org/browse/keyword/karma-reporter |
| 55 | + reporters: ['progress'], |
| 56 | + |
| 57 | + // web server port |
| 58 | + port: 9876, |
| 59 | + |
| 60 | + // enable / disable colors in the output (reporters and logs) |
| 61 | + colors: true, |
| 62 | + |
| 63 | + // level of logging |
| 64 | + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG |
| 65 | + logLevel: config.LOG_INFO, |
| 66 | + |
| 67 | + // enable / disable watching file and executing tests whenever any file changes |
| 68 | + autoWatch: false, |
| 69 | + |
| 70 | + // Continuous Integration mode |
| 71 | + // if true, Karma captures browsers, runs the tests and exits |
| 72 | + singleRun: false, |
| 73 | + |
| 74 | + // Concurrency level |
| 75 | + // how many browser should be started simultaneous |
| 76 | + concurrency: Infinity, |
| 77 | + |
| 78 | + // all other options that are defined in |
| 79 | + // local.karma.conf.js were elided for the |
| 80 | + // purpose of this blog post. |
| 81 | + reporters: ['saucelabs', 'progress'], // 2 |
| 82 | + browsers: Object.keys(browsers), // 3 |
| 83 | + customLaunchers: browsers // 4 |
| 84 | + }) |
| 85 | +} |
0 commit comments