Skip to content

Commit

Permalink
Merge pull request #168 from nsthorat/master
Browse files Browse the repository at this point in the history
Set up browserstack.
  • Loading branch information
cvalenzuela authored Jun 24, 2018
2 parents 3ed1ec1 + f2bf9ee commit f6060ad
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 9,993 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ website/node_modules

website/i18n/*
!website/i18n/en.json

yarn-error.log
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ node_js:
git:
depth: 5
script:
- yarn build
- yarn build
- yarn test-travis
55 changes: 20 additions & 35 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,61 +1,46 @@
// Karma configuration
// Generated on Thu Mar 29 2018 11:50:44 GMT-0400 (EDT)

module.exports = (config) => {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
'src/*/*.test.js',
'src/images/*.jpg',
'src/**/*_test.js',
],
// list of files / patterns to exclude
exclude: [],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
// add webpack as preprocessor
'src/*/*.test.js': ['webpack'],
'src/**/*_test.js': ['webpack'],
},
webpack: {
// karma watches the test entry points
// (you don't need to specify the entry option)
// webpack watches dependencies

// webpack configuration

},
webpackMiddleware: {
// webpack-dev-middleware configuration
// i. e.
noInfo: true,
stats: 'errors-only',
},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
browserStack: {
username: process.env.BROWSERSTACK_USERNAME,
accessKey: process.env.BROWSERSTACK_ACCESS_KEY
},
captureTimeout: 120000,
reportSlowerThan: 500,
browserNoActivityTimeout: 180000,
customLaunchers: {
bs_chrome_mac: {
base: 'BrowserStack',
browser: 'chrome',
browser_version: 'latest',
os: 'OS X',
os_version: 'High Sierra'
},
},
reporters: ['progress'],
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
// browsers: ['Chrome', 'Firefox', 'Safari'],
browsers: ['Chrome'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,
// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity,
concurrency: Infinity
});
};
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"prebuild": "rimraf dist",
"start": "webpack-dev-server --open --config webpack.dev.babel.js",
"build": "webpack --config webpack.prod.babel.js",
"test:dev": "./node_modules/karma/bin/karma start karma.conf.js",
"test": "./node_modules/karma/bin/karma start karma.conf.js --no-auto-watch --single-run"
"test": "./node_modules/karma/bin/karma start karma.conf.js",
"test-travis": "./scripts/test-travis.sh"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -48,10 +48,9 @@
"html-webpack-plugin": "^3.0.7",
"jasmine-core": "3.1.0",
"karma": "2.0.0",
"karma-browserstack-launcher": "~1.3.0",
"karma-chrome-launcher": "2.2.0",
"karma-firefox-launcher": "1.1.0",
"karma-jasmine": "1.1.1",
"karma-safari-launcher": "1.0.0",
"karma-webpack": "3.0.0",
"npm-run-all": "4.1.2",
"regenerator-runtime": "0.11.1",
Expand Down
7 changes: 7 additions & 0 deletions scripts/test-travis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

if [[ $(node -v) = *v10* ]]; then
karma start \
--browsers='bs_chrome_mac' \
--singleRun --reporters='dots,progress,BrowserStack'
fi
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit f6060ad

Please sign in to comment.