feat: support run single test

This commit is contained in:
陈嘉涵
2017-08-24 20:36:42 +08:00
parent c6b8de3541
commit 057049c15a
5 changed files with 126 additions and 93 deletions
+7 -2
View File
@@ -4,7 +4,7 @@ require('babel-core/register')({
presets: [require('babel-preset-env')]
});
var webpackConfig = require('./get-webpack-conf');
var getWebpackConfig = require('./get-webpack-conf');
var travis = process.env.TRAVIS;
module.exports = function(config) {
@@ -16,7 +16,7 @@ module.exports = function(config) {
preprocessors: {
'./index.js': ['webpack', 'sourcemap']
},
webpack: webpackConfig,
webpack: getWebpackConfig(getTestFileName()),
webpackMiddleware: {
noInfo: true
},
@@ -30,3 +30,8 @@ module.exports = function(config) {
singleRun: false
});
};
function getTestFileName() {
const flagIndex = process.argv.indexOf('--file');
return flagIndex !== -1 ? process.argv[flagIndex + 1] : '';
}