Skip to content

Commit e38527f

Browse files
taiontimdorr
authored andcommitted
Fix my mistakes in test setup (#3637)
* Fix my mistakes in test setup * Update dependencies
1 parent 112cce4 commit e38527f

File tree

5 files changed

+34
-46
lines changed

5 files changed

+34
-46
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ cache:
66
directories:
77
- node_modules
88
before_install:
9-
- export CHROME_BIN=chromium-browser
10-
- export DISPLAY=:99.0
11-
- sh -e /etc/init.d/xvfb start
9+
- export CHROME_BIN=chromium-browser
10+
- export DISPLAY=:99.0
11+
- sh -e /etc/init.d/xvfb start
1212
after_success:
1313
- cat ./coverage/lcov.info | ./node_modules/codecov.io/bin/codecov.io.js
1414
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js

karma.conf.js

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
/*eslint no-console: 0*/
2-
var webpack = require('webpack')
3-
var path = require('path')
1+
const webpack = require('webpack')
2+
const path = require('path')
43

5-
module.exports = function (config) {
4+
module.exports = config => {
65
if (process.env.RELEASE)
76
config.singleRun = true
87

9-
var customLaunchers = {
8+
const customLaunchers = {
109
// Browsers to run on BrowserStack.
1110
BS_Chrome: {
1211
base: 'BrowserStack',
@@ -29,14 +28,14 @@ module.exports = function (config) {
2928
browser: 'safari',
3029
browser_version: '9.0'
3130
},
32-
BS_MobileSafari: {
31+
BS_MobileSafari8: {
3332
base: 'BrowserStack',
3433
os: 'ios',
3534
os_version: '8.3',
3635
browser: 'iphone',
3736
real_mobile: false
3837
},
39-
BS_MobileSafari: {
38+
BS_MobileSafari9: {
4039
base: 'BrowserStack',
4140
os: 'ios',
4241
os_version: '9.1',
@@ -65,29 +64,12 @@ module.exports = function (config) {
6564
}
6665
}
6766

68-
var isCi = process.env.CONTINUOUS_INTEGRATION === 'true'
69-
var runCoverage = process.env.COVERAGE === 'true' || isCi
70-
71-
var coverageLoaders = []
72-
var coverageReporters = []
73-
74-
if (runCoverage) {
75-
coverageLoaders.push({
76-
test: /\.js$/,
77-
include: path.resolve('modules/'),
78-
exclude: /__tests__/,
79-
loader: 'isparta'
80-
})
81-
82-
coverageReporters.push('coverage')
83-
}
84-
8567
config.set({
8668
customLaunchers: customLaunchers,
8769

8870
browsers: [ 'Chrome' ],
8971
frameworks: [ 'mocha' ],
90-
reporters: [ 'mocha' ].concat(coverageReporters),
72+
reporters: [ 'mocha', 'coverage' ],
9173

9274
files: [
9375
'tests.webpack.js'
@@ -98,11 +80,17 @@ module.exports = function (config) {
9880
},
9981

10082
webpack: {
101-
devtool: 'inline-source-map',
83+
devtool: 'cheap-module-inline-source-map',
10284
module: {
10385
loaders: [
104-
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel' }
105-
].concat(coverageLoaders)
86+
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel' },
87+
{
88+
test: /\.js$/,
89+
include: path.resolve('modules/'),
90+
exclude: /__tests__/,
91+
loader: 'isparta'
92+
}
93+
]
10694
},
10795
plugins: [
10896
new webpack.DefinePlugin({
@@ -132,7 +120,7 @@ module.exports = function (config) {
132120
config.captureTimeout = 120000
133121

134122
if (process.env.TRAVIS) {
135-
var buildLabel = 'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER + ' (' + process.env.TRAVIS_BUILD_ID + ')'
123+
const buildLabel = 'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER + ' (' + process.env.TRAVIS_BUILD_ID + ')'
136124

137125
config.browserStack = {
138126
username: process.env.BROWSER_STACK_USERNAME,

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"build-es": "rimraf es6 && cross-env BABEL_ENV=es babel ./modules -d es6 --ignore '__tests__'",
2121
"build-umd": "cross-env BABEL_ENV=cjs NODE_ENV=development webpack modules/index.js umd/ReactRouter.js",
2222
"build-min": "cross-env BABEL_ENV=cjs NODE_ENV=production webpack -p modules/index.js umd/ReactRouter.min.js",
23-
"lint": "eslint modules examples",
23+
"lint": "eslint modules examples *.js",
2424
"start": "cross-env BABEL_ENV=cjs node examples/server.js",
2525
"test": "npm run lint && npm run test-node && npm run test-browser",
2626
"test-browser": "cross-env BABEL_ENV=cjs karma start",
@@ -44,7 +44,7 @@
4444
"devDependencies": {
4545
"babel-cli": "^6.10.1",
4646
"babel-core": "^6.10.4",
47-
"babel-eslint": "^6.1.0",
47+
"babel-eslint": "^6.1.2",
4848
"babel-loader": "^6.2.4",
4949
"babel-plugin-add-module-exports": "^0.2.1",
5050
"babel-plugin-dev-expression": "^0.2.1",
@@ -56,33 +56,33 @@
5656
"babel-register": "^6.9.0",
5757
"bundle-loader": "^0.5.4",
5858
"codecov.io": "^0.1.6",
59-
"coveralls": "^2.11.9",
60-
"cross-env": "^1.0.8",
59+
"coveralls": "^2.11.11",
60+
"cross-env": "^2.0.0",
6161
"css-loader": "^0.23.1",
62-
"eslint": "^3.0.0",
62+
"eslint": "^3.0.1",
6363
"eslint-config-rackt": "^1.1.1",
6464
"eslint-plugin-react": "^5.2.2",
6565
"expect": "^1.20.2",
6666
"express": "^4.14.0",
6767
"express-urlrewrite": "^1.2.0",
6868
"gzip-size": "^3.0.0",
6969
"isparta-loader": "^2.0.0",
70-
"karma": "^1.1.0",
70+
"karma": "^1.1.1",
7171
"karma-browserstack-launcher": "^1.0.1",
7272
"karma-chrome-launcher": "^1.0.1",
73-
"karma-coverage": "^1.0.0",
73+
"karma-coverage": "^1.1.0",
7474
"karma-mocha": "^1.1.1",
7575
"karma-mocha-reporter": "^2.0.4",
7676
"karma-sourcemap-loader": "^0.3.7",
7777
"karma-webpack": "^1.7.0",
7878
"mocha": "^2.5.3",
7979
"pretty-bytes": "^3.0.1",
8080
"qs": "^6.2.0",
81-
"react": "^15.2.0",
82-
"react-addons-css-transition-group": "^15.2.0",
83-
"react-addons-test-utils": "^15.2.0",
84-
"react-dom": "^15.2.0",
85-
"rimraf": "^2.5.2",
81+
"react": "^15.2.1",
82+
"react-addons-css-transition-group": "^15.2.1",
83+
"react-addons-test-utils": "^15.2.1",
84+
"react-dom": "^15.2.1",
85+
"rimraf": "^2.5.3",
8686
"style-loader": "^0.13.1",
8787
"webpack": "^1.13.1",
8888
"webpack-dev-middleware": "^1.6.1"

tests.webpack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/* eslint-disable no-console */
21
/* eslint-env mocha */
2+
/* eslint-disable no-console */
33

44
import expect from 'expect'
55

webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var webpack = require('webpack')
1+
const webpack = require('webpack')
22

33
module.exports = {
44

0 commit comments

Comments
 (0)