Skip to content

Commit

Permalink
chore: update test deps and conf (ElemeFE#14735)
Browse files Browse the repository at this point in the history
* test: run in headless chrome

* chore: update travis node version

* chore: upgrade test deps

* test: fix tests

* test: support async await

* test: fix tree test case

* test: fix tree test cases

* test: fix popper test case
  • Loading branch information
wacky6 authored and ziyoung committed Mar 18, 2019
1 parent e6cb64b commit 9c7fcf3
Show file tree
Hide file tree
Showing 18 changed files with 792 additions and 899 deletions.
7 changes: 1 addition & 6 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
{
"env": {
"mocha": true
},
"globals": {
"ga": true,
"expect": true,
"sinon": true
"ga": true
},
"plugins": ["html", "json"],
"extends": "elemefe",
Expand Down
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
sudo: false
language: node_js
node_js: 8
node_js: 10
addons:
chrome: stable
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- export TRAVIS_COMMIT_MSG="[deploy] $(git log --format='%h - %B' --no-merges -n 1)"
- export TRAVIS_COMMIT_USER="$(git log --no-merges -n 1 --format=%an)"
- export TRAVIS_COMMIT_EMAIL="$(git log --no-merges -n 1 --format=%ae)"
Expand Down
23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@
"babel-plugin-transform-vue-jsx": "^3.7.0",
"babel-preset-env": "^1.7.0",
"babel-preset-stage-2": "^6.24.1",
"chai": "^3.5.0",
"babel-regenerator-runtime": "^6.5.0",
"chai": "^4.2.0",
"chokidar": "^1.7.0",
"copy-webpack-plugin": "^5.0.0",
"coveralls": "^2.11.14",
"coveralls": "^3.0.3",
"cp-cli": "^1.0.2",
"cross-env": "^3.1.3",
"css-loader": "^2.1.0",
Expand All @@ -104,20 +105,20 @@
"html-webpack-plugin": "^3.2.0",
"json-loader": "^0.5.7",
"json-templater": "^1.0.4",
"karma": "^1.3.0",
"karma": "^4.0.1",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "^1.1.1",
"karma-mocha": "^1.2.0",
"karma-sinon-chai": "^1.2.4",
"karma-coverage": "^1.1.2",
"karma-mocha": "^1.3.0",
"karma-sinon-chai": "^2.0.2",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "0.0.26",
"karma-webpack": "^3.0.0",
"karma-spec-reporter": "^0.0.32",
"karma-webpack": "^3.0.5",
"markdown-it": "^8.4.1",
"markdown-it-anchor": "^5.0.2",
"markdown-it-chain": "^1.3.0",
"markdown-it-container": "^2.0.0",
"mini-css-extract-plugin": "^0.4.1",
"mocha": "^3.1.1",
"mocha": "^6.0.2",
"node-sass": "^4.11.0",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"perspective.js": "^1.0.0",
Expand All @@ -126,8 +127,8 @@
"rimraf": "^2.5.4",
"sass-loader": "^7.1.0",
"select-version-cli": "^0.0.2",
"sinon": "^1.17.6",
"sinon-chai": "^2.8.0",
"sinon": "^7.2.7",
"sinon-chai": "^3.3.0",
"style-loader": "^0.23.1",
"transliteration": "^1.1.11",
"uglifyjs-webpack-plugin": "^2.1.1",
Expand Down
13 changes: 13 additions & 0 deletions test/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"env": {
"mocha": true,
"es6": true
},
"globals": {
"expect": true,
"sinon": true
},
"parserOptions": {
"ecmaVersion": 2017
}
}
4 changes: 1 addition & 3 deletions test/unit/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Polyfill fn.bind() for PhantomJS
/* eslint-disable no-extend-native */
Function.prototype.bind = require('function-bind');
require('babel-regenerator-runtime'); // add regenerator support for async await
require('packages/theme-chalk/lib/index.css');

// require all test files (files that ends with .spec.js)
Expand Down
12 changes: 1 addition & 11 deletions test/unit/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@ const webpackConfig = require('../../build/webpack.test');

module.exports = function(config) {
const configuration = {
browsers: ['Chrome'],
customLaunchers: {
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},
browsers: ['ChromeHeadless'],
frameworks: ['mocha', 'sinon-chai'],
reporters: ['spec', 'coverage'],
files: ['./index.js'],
Expand All @@ -33,9 +27,5 @@ module.exports = function(config) {
}
};

if (process.env.TRAVIS) {
configuration.browsers = ['Chrome_travis_ci'];
}

config.set(configuration);
};
Loading

0 comments on commit 9c7fcf3

Please sign in to comment.