Skip to content

Commit

Permalink
Added new npm-script 'hint-tests'
Browse files Browse the repository at this point in the history
  • Loading branch information
dyuvzhenko committed Nov 15, 2017
1 parent 9ada21c commit 1bd7bf6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
19 changes: 10 additions & 9 deletions webpack/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -44,7 +44,8 @@ if (ENV === 'development') {

devtool: 'inline-source-map',

entry: testFiles,
// entry: testFiles,
entry: {},

plugins: [],

Expand Down

0 comments on commit 1bd7bf6

Please sign in to comment.