|
@ -22,7 +22,7 @@ module.exports = function(config) { |
|
|
'node_modules/video.js/dist/video-js.css', |
|
|
'node_modules/video.js/dist/video-js.css', |
|
|
'dist-test/browserify-test.js', |
|
|
'dist-test/browserify-test.js', |
|
|
'dist-test/webpack-test.js', |
|
|
'dist-test/webpack-test.js', |
|
|
'dist-test/videojs-http-streaming.js' |
|
|
|
|
|
|
|
|
'test/**/*.test.js' |
|
|
], |
|
|
], |
|
|
browserConsoleLogOptions: { |
|
|
browserConsoleLogOptions: { |
|
|
level: 'error', |
|
|
level: 'error', |
|
@ -36,6 +36,11 @@ module.exports = function(config) { |
|
|
captureTimeout: 600, |
|
|
captureTimeout: 600, |
|
|
timeout: 600 |
|
|
timeout: 600 |
|
|
}, |
|
|
}, |
|
|
|
|
|
coverageReporter: { |
|
|
|
|
|
reporters: [{ |
|
|
|
|
|
type: 'text-summary' |
|
|
|
|
|
}] |
|
|
|
|
|
}, |
|
|
customLaunchers: { |
|
|
customLaunchers: { |
|
|
ChromeHeadlessWithFlags: { |
|
|
ChromeHeadlessWithFlags: { |
|
|
base: 'ChromeHeadless', |
|
|
base: 'ChromeHeadless', |
|
@ -99,29 +104,24 @@ module.exports = function(config) { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
preprocessors: { |
|
|
preprocessors: { |
|
|
|
|
|
'src/**/*.js': ['browserify', 'coverage'], |
|
|
'test/**/*.test.js': ['browserify'] |
|
|
'test/**/*.test.js': ['browserify'] |
|
|
}, |
|
|
}, |
|
|
browserify: { |
|
|
browserify: { |
|
|
debug: true, |
|
|
debug: true, |
|
|
transform: [ |
|
|
transform: [ |
|
|
'babelify', |
|
|
'babelify', |
|
|
['browserify-shim', { global: true }] |
|
|
|
|
|
|
|
|
['browserify-shim', { global: true }], |
|
|
|
|
|
istanbul({ |
|
|
|
|
|
instrumenter: isparta, |
|
|
|
|
|
ignore: ['**/node_modules/**', '**/test/**'] |
|
|
|
|
|
}) |
|
|
], |
|
|
], |
|
|
noParse: [ |
|
|
noParse: [ |
|
|
'test/data/**', |
|
|
'test/data/**', |
|
|
] |
|
|
] |
|
|
}, |
|
|
}, |
|
|
babelPreprocessor: { |
|
|
|
|
|
options: { |
|
|
|
|
|
presets: ['es2015'], |
|
|
|
|
|
sourceMap: 'inline' |
|
|
|
|
|
}, |
|
|
|
|
|
sourceFileName: function (file) { |
|
|
|
|
|
return file.originalPath; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
reporters: ['dots'], |
|
|
|
|
|
|
|
|
reporters: ['dots', 'coverage'], |
|
|
port: 9876, |
|
|
port: 9876, |
|
|
colors: true, |
|
|
colors: true, |
|
|
autoWatch: false, |
|
|
autoWatch: false, |
|
@ -132,19 +132,4 @@ module.exports = function(config) { |
|
|
browserDisconnectTimeout: 300000, |
|
|
browserDisconnectTimeout: 300000, |
|
|
browserDisconnectTolerance: 3 |
|
|
browserDisconnectTolerance: 3 |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
// Coverage reporting
|
|
|
|
|
|
// Coverage is enabled by passing the flag --coverage to npm test
|
|
|
|
|
|
var coverageFlag = process.env.npm_config_coverage; |
|
|
|
|
|
var reportCoverage = process.env.TRAVIS || coverageFlag; |
|
|
|
|
|
|
|
|
|
|
|
if (reportCoverage) { |
|
|
|
|
|
config.reporters.push('coverage'); |
|
|
|
|
|
config.browserify.transform.push(istanbul({ |
|
|
|
|
|
instrumenter: isparta, |
|
|
|
|
|
ignore: ['**/node_modules/**', '**/test/**'] |
|
|
|
|
|
})); |
|
|
|
|
|
config.preprocessors['src/**/*.js'] = ['browserify', 'coverage']; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
}; |