Skip to content

Commit

Permalink
prod build & test
Browse files Browse the repository at this point in the history
  • Loading branch information
dhilt committed Nov 13, 2017
1 parent baa18e5 commit fb7f7f0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 20 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
},
"license": "MIT",
"scripts": {
"build": "webpack --config webpack/config.js",
"prod-build": "webpack --config webpack/config.js",
"prod-test": "karma start test/config/karma.conf.js",
"dev-build": "webpack --config webpack/config.js",
"dev-test": "karma start test/config/karma.conf.js",
"test": "concurrently --kill-others --raw \"npm run dev-build\" \"npm run dev-test\""
"test": "concurrently --kill-others --raw \"npm run dev-build\" \"npm run dev-test\"",
"build": "npm run prod-build && npm run prod-test"
},
"devDependencies": {
"babel-core": "^6.24.1",
Expand Down
24 changes: 14 additions & 10 deletions test/config/karma.conf.files.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,23 @@ var files = [
'../misc/test.css',
'../misc/datasources.js',
'../misc/scaffolding*.js',
'../*Spec.js',
'../*Spec.js'
];

module.exports.development = files.concat([
'../../temp/ui-scroll.js',
'../../temp/ui-scroll-grid.js',
{
pattern: scrollerPath + '*.js.map',
pattern: '../../temp/*.js.map',
included: false
}
];

module.exports.defaultFiles = files.concat([
scrollerPath + 'ui-scroll.js',
scrollerPath + 'ui-scroll-grid.js'
]);

module.exports.compressedFiles = files.concat([
scrollerPath + 'ui-scroll.min.js',
scrollerPath + 'ui-scroll-grid.min.js'
module.exports.production = files.concat([
'../../dist/ui-scroll.min.js',
'../../dist/ui-scroll-grid.min.js',
{
pattern: '../../dist/*.js.map',
included: false
}
]);
18 changes: 10 additions & 8 deletions test/config/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
var chrome = process.platform === 'linux' ? 'Chromium' : 'Chrome';
var firefox = 'Firefox';
var ie = 'IE';
const chrome = process.platform === 'linux' ? 'Chromium' : 'Chrome';
const firefox = 'Firefox';
const ie = 'IE';

const ENV = (process.env.npm_lifecycle_event.indexOf('dev') === 0) ? 'development' : 'production';

module.exports = function (config) {
config.set({
Expand All @@ -9,28 +11,28 @@ module.exports = function (config) {

frameworks: ['jasmine'],

files: require('./karma.conf.files.js').defaultFiles,
files: require('./karma.conf.files.js')[ENV],

exclude: [],

reporters: ['dots'],

port: 8082,
port: ENV === 'development' ? 9100 : 8082,

colors: true,

logLevel: config.LOG_INFO,

autoWatch: true,
autoWatch: ENV === 'development',

keepalive: true,
keepalive: ENV === 'development',

browsers: process.env.TRAVIS ?
[firefox, chrome] :
[chrome],

captureTimeout: 60000,

singleRun: false
singleRun: ENV !== 'development'
});
};

0 comments on commit fb7f7f0

Please sign in to comment.