From 1bd7bf6fd3f67a7502e43dc71906431fc7a551da Mon Sep 17 00:00:00 2001 From: BitDen Date: Thu, 16 Nov 2017 02:30:34 +0800 Subject: [PATCH] Added new npm-script 'hint-tests' --- package.json | 3 ++- webpack/config.js | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index e3d8dcac..0690521c 100644 --- a/package.json +++ b/package.json @@ -24,8 +24,9 @@ "dev-build": "webpack --config webpack/config.js", "dev-server": "webpack-dev-server --config webpack/config.js", "dev-test": "karma start test/config/karma.conf.js", + "hint-tests": "jshint test/*Spec.js", "start": "npm run dev-server", - "test": "npm run dev-test", + "test": "npm run hint-tests && npm run dev-test", "build": "npm run prod-build && npm run prod-test" }, "devDependencies": { diff --git a/webpack/config.js b/webpack/config.js index af5d05e1..e2571690 100644 --- a/webpack/config.js +++ b/webpack/config.js @@ -18,14 +18,14 @@ console.log('********** webpack runs in ' + ENV + ' environment **********\n'); let configEnv = {}; -const arrTestFiles = fs.readdirSync('test') - .map(e => (e.indexOf('Spec.js') !== -1) ? - {[e.replace(/\.js/, '')]: path.resolve(__dirname, '../test/' + e)} : null - ) - .filter(e => e !== null); - -let testFiles = {}; -arrTestFiles.forEach(e => testFiles[Object.keys(e)[0]] = e[Object.keys(e)[0]]); +// const arrTestFiles = fs.readdirSync('test') +// .map(e => (e.indexOf('Spec.js') !== -1) ? +// {[e.replace(/\.js/, '')]: path.resolve(__dirname, '../test/' + e)} : null +// ) +// .filter(e => e !== null); +// +// let testFiles = {}; +// arrTestFiles.forEach(e => testFiles[Object.keys(e)[0]] = e[Object.keys(e)[0]]); if (ENV === 'development') { configEnv = { @@ -44,7 +44,8 @@ if (ENV === 'development') { devtool: 'inline-source-map', - entry: testFiles, + // entry: testFiles, + entry: {}, plugins: [],