|
1 | | -const base = require('./karma.base') |
2 | | - |
3 | | -var getFiles = function () { |
4 | | - var files = [ |
5 | | - { |
6 | | - pattern: require('path').join(process.cwd(), './dist/author-element.es5.js'), |
7 | | - nocache: true |
8 | | - } |
9 | | - ] |
10 | | - |
11 | | - // Run all tests by default |
12 | | - let testfiles = 'test/es5/*.js' |
13 | | - |
14 | | - return files.concat([ |
15 | | - testfiles, |
16 | | - 'test/es5/test.html' |
17 | | - ]) |
18 | | -} |
19 | | - |
20 | | -console.log(base.tablemaker([[base.chalk.bold('Included Files')]].concat(getFiles().map(file => { return [file] })))) |
21 | | - |
22 | | -module.exports = function (config) { |
23 | | - config.set({ |
24 | | - |
25 | | - plugins: [ |
26 | | - require('karma-browserify'), |
27 | | - require('tape'), |
28 | | - require('karma-tap'), |
29 | | - require('karma-spec-reporter'), |
30 | | - require('karma-chrome-launcher'), |
31 | | - // require('karma-firefox-launcher'), |
32 | | - // require('karma-safari-launcher'), |
33 | | - // require('karma-ie-launcher'), |
34 | | - // require('karma-edge-launcher'), |
35 | | - // require('karma-phantomjs-launcher'), |
36 | | - // require('karma-sauce-launcher'), |
37 | | - require('karma-html2js-preprocessor') |
38 | | - ], |
39 | | - |
40 | | - // base path that will be used to resolve all patterns (eg. files, exclude) |
41 | | - basePath: '', |
42 | | - |
43 | | - // frameworks to use |
44 | | - // available frameworks: https://npmjs.org/browse/keyword/karma-adapter |
45 | | - frameworks: ['tap', 'browserify'], |
46 | | - |
47 | | - // list of files / patterns to load in the browser |
48 | | - files: getFiles(), |
49 | | - |
50 | | - // list of files to exclude |
51 | | - exclude: [], |
52 | | - |
53 | | - // preprocess matching files before serving them to the browser |
54 | | - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor |
55 | | - preprocessors: { |
56 | | - 'test/es5/**/*.js': ['browserify'], |
57 | | - 'test/es5/test.html': 'html2js' |
58 | | - // , 'test/lib/**/*.js': 'coverage' |
59 | | - }, |
60 | | - |
61 | | - // coverageReporter: { |
62 | | - // type : 'html', |
63 | | - // dir : 'coverage/' |
64 | | - // }, |
65 | | - |
66 | | - // test results reporter to use |
67 | | - // possible values: 'dots', 'progress' |
68 | | - // available reporters: https://npmjs.org/browse/keyword/karma-reporter |
69 | | - reporters: base.reporterEngines, // ['progress'], |
70 | | - |
71 | | - // web server port |
72 | | - port: 9876, |
73 | | - |
74 | | - // enable / disable colors in the output (reporters and logs) |
75 | | - colors: true, |
76 | | - |
77 | | - // level of logging |
78 | | - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG |
79 | | - logLevel: config.LOG_DEBUG, |
80 | | - |
81 | | - // enable / disable watching file and executing tests whenever any file changes |
82 | | - autoWatch: false, |
83 | | - |
84 | | - // start these browsers |
85 | | - // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher |
86 | | - browsers: ['Chrome'], |
87 | | - |
88 | | - // Continuous Integration mode |
89 | | - // if true, Karma captures browsers, runs the tests and exits |
90 | | - singleRun: true, |
91 | | - |
92 | | - // Concurrency level |
93 | | - // how many browser should be started simultanous |
94 | | - concurrency: 3 |
95 | | - }) |
| 1 | +let customize = require('@author.io/karma-customelements')('test/es5', './dist/author-__ELEMENT_NAME__.es5.js', 'BrowserStack') |
| 2 | + |
| 3 | +module.exports = config => { |
| 4 | + config.set(Object.assign(customize(config), { |
| 5 | + captureTimeout: 120000, |
| 6 | + browserNoActivityTimeout: 120000, |
| 7 | + concurrency: 3, |
| 8 | + logLevel: config.LOG_INFO |
| 9 | + })) |
96 | 10 | } |
0 commit comments