feat: support run single test
This commit is contained in:
@@ -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] : '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user