mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
28 lines
688 B
JavaScript
28 lines
688 B
JavaScript
const getWebpackConfig = require('./get-webpack-conf');
|
|
|
|
module.exports = function(config) {
|
|
config.set({
|
|
browsers: ['ChromeHeadless'],
|
|
frameworks: ['mocha', 'sinon-chai'],
|
|
reporters: ['spec', 'coverage'],
|
|
files: ['./index.js'],
|
|
preprocessors: {
|
|
'./index.js': ['webpack']
|
|
},
|
|
webpack: getWebpackConfig(getTestFileName()),
|
|
coverageReporter: {
|
|
dir: './coverage',
|
|
reporters: [
|
|
{ type: 'lcov', subdir: '.' },
|
|
{ type: 'text-summary' }
|
|
]
|
|
},
|
|
singleRun: false
|
|
});
|
|
};
|
|
|
|
function getTestFileName() {
|
|
const flagIndex = process.argv.indexOf('--file');
|
|
return flagIndex !== -1 ? process.argv[flagIndex + 1] : '';
|
|
}
|