Skip to content

Commit

Permalink
Update test config
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed Oct 20, 2016
1 parent 94d987f commit 38875f1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ cache:
- node_modules
- travis_phantomjs
before_install:
- export TRAVIS_COMMIT_MSG="[deploy] $(git log --format='%h - %B' --no-merges -n 1)"
- export PHANTOMJS_VERSION=2.1.1
- export PATH=$PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin:$PATH
- if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then rm -rf $PWD/travis_phantomjs;
Expand Down
12 changes: 7 additions & 5 deletions build/cooking.test.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
var path = require('path');
var cooking = require('cooking');
var config = require('./config');
var ProgressBarPlugin = require('progress-bar-webpack-plugin');
var jsLoader = process.env.CI_ENV ? 'isparta-loader' : 'isparta-loader!eslint-loader';

cooking.set({
entry: './src/index.js',
extends: ['vue2', 'lint'],
extends: process.env.CI_ENV ? ['vue2'] : ['vue2', 'lint'],
minimize: false,
alias: config.alias,
postcss: config.postcss,
sourceMap: '#inline-source-map'
});

cooking.add('vue.loaders.js', 'isparta-loader!eslint-loader');
cooking.add('vue.loaders.js', jsLoader);
cooking.add('loader.js.exclude', config.jsexclude);
cooking.add('preLoader.js', {
test: /\.js$/,
loader: 'isparta-loader!eslint-loader',
loader: jsLoader,
exclude: config.jsexclude
});

cooking.add('plugins.process', new ProgressBarPlugin());
if (!process.env.CI_ENV) {
cooking.add('plugins.process', new ProgressBarPlugin());
}
module.exports = cooking.resolve();
6 changes: 3 additions & 3 deletions build/deploy-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ if [ "$TRAVIS_BRANCH" = "master" ] && [ "$GH_TOKEN" ]; then
mkdir temp_web
cd temp_web
git clone https://$GH_TOKEN@github.com/ElementUI/dev.git && cd dev
git config user.name "travis"
git config user.email "travis"
git config user.name "$(git log --no-merges -n 1 --format=%an)"
git config user.email "$(git log --no-merges -n 1 --format=%ae)"
rm -rf *
cp -rf ../../examples/element-ui/** .
git add -A .
git commit -m "$TRAVIS_COMMIT"
git commit -m "$TRAVIS_COMMIT_MSG"
git push origin master
fi
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"clean": "rimraf lib && rimraf packages/*/lib",
"lint": "eslint src/**/* test/**/* packages/**/*.{js,vue} build/**/* --quiet",
"test:watch": "karma start test/unit/karma.conf.js",
"test": "npm run lint && karma start test/unit/karma.conf.js --single-run"
"test": "npm run lint && CI_ENV=/dev/ karma start test/unit/karma.conf.js --single-run"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 38875f1

Please sign in to comment.