Permalink
Browse files

Switch to karma and browserstack for running tests

  • Loading branch information...
brycekahle committed Sep 20, 2018
1 parent 841e035 commit 60f5599c49450453dac6e8feb0ffd6e2328bd546
View
@@ -6,7 +6,6 @@ dist/
!dist/sockjs.min.js.map
build/
.travis.yml
.zuul.yml
.eslintrc
.jscsrc
bower.json
View
@@ -3,39 +3,12 @@ git:
depth: 1
before_install: npm install -g npm@latest
script:
- ./build.sh
- "./build.sh"
env:
global:
- secure: L36j3mbU1U2FiOhxYZrTZ7apVnb56gE+QFixsYyDpCRBrVW0q8WR9LTMJx+aPNdlzhRS5FT4gfInujPTnZeb+EvqEoYwtT+CeNG15XtGkfJDkfBFjBa4IZpJAjIwJB+0kKkZr9R7lQEEgy7H9FvLHY2N2WgdzuG8WZwiVRnkwVw=
- secure: K6NxT5qIzV/4Ce1HqoYMdpFtqxx5S5Ua/sKp1bbHCXTCft6gLBR3mrf1RR14Wj9AwcM9QY6YbNF/dXGmBdMNtiJN+a2nvcfIoPTGJ3UpK4r2xI5w/U+uhRQMxD55SkWaxUIPvEfgvwyETSpFZRYACnNkpxeQWMkdc14vk74Feu0=
- secure: R1UPJgVqB3D25tOYVsE3aP3gzROaUQfkfmklz2c/NJ41bRKrrtnCw4fh0yf+38m0LPXdJMLHsyBXER8U9DYX4QkEqA11kOFCGeuENtMhK/fNKJrfA5BRFez7HHsy+KUrEFooJLan/qAcNDzMItOBie5LP/RODA7x67SItAHyjtI=
- secure: GNUoX4+vkYOftjQ3IBZSYm+yRIo0y4tM9jCTKT4gWHUvDLr/U4K8GoYu5OHqQK6gvAM5RXmhvVFcEbVqZW3J11UbAFEwWEwjzZtxCaJPA0C/U0mcp1dUr0O5Cf/WT/OVyYKVG0+nLfJ4EWP1XKDQRTDtd7mNx66bRCzYmqb2vPo=
- secure: KPeveacugD2N5EDhmX1surPMoXtndyk/1ZWELgazA46y9yIi0g9fy+3290ORyIlzB64OBoZtb/U9Yb0CX5kewIsTifiqBto8tTPMH5gK7a/oYWedNlzRjLikuT1GaeL9p3gHc0HRKa359YYf0NObdoPr1+7hQ/PSdVwuk2mgua0=
matrix:
include:
- env: NODE_ENV=development
- env: BROWSER=true
#- env: BROWSER_NAME=chrome BROWSER_VERSION=latest
#- env: BROWSER_NAME=firefox BROWSER_VERSION=latest
#- env: BROWSER_NAME=microsoftedge BROWSER_VERSION=latest
#- env: BROWSER_NAME=safari BROWSER_VERSION=7
#- env: BROWSER_NAME=safari BROWSER_VERSION=8
#- env: BROWSER_NAME=safari BROWSER_VERSION=9
#- env: BROWSER_NAME=safari BROWSER_VERSION=10
#- env: BROWSER_NAME=ie BROWSER_VERSION=8 BROWSER_PLATFORM="Windows 7"
#- env: BROWSER_NAME=ie BROWSER_VERSION=9
#- env: BROWSER_NAME=ie BROWSER_VERSION=10 BROWSER_PLATFORM="Windows 2012"
#- env: BROWSER_NAME=ie BROWSER_VERSION=11 BROWSER_PLATFORM="Windows 2012"
#- env: BROWSER_NAME=iphone BROWSER_VERSION=8.4
#- env: BROWSER_NAME=iphone BROWSER_VERSION=9.3
#- env: BROWSER_NAME=iphone BROWSER_VERSION=10
# Android VMs on Sauce Labs don't seem to work correctly
# env: BROWSER_NAME=android BROWSER_VERSION=4.1
# env: BROWSER_NAME=android BROWSER_VERSION=4.2
# env: BROWSER_NAME=android BROWSER_VERSION=4.3
# env: BROWSER_NAME=android BROWSER_VERSION=4.4
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/be9ef89cdfc53fc9c60c
on_success: change
on_start: never
on_failure: change
View

This file was deleted.

Oops, something went wrong.
View
@@ -2,7 +2,7 @@
# SockJS-client
[![npm version](https://img.shields.io/npm/v/sockjs-client.svg?style=flat-square)](https://www.npmjs.com/package/sockjs-client)[![Build Status](https://img.shields.io/travis/sockjs/sockjs-client/master.svg?style=flat-square)](https://travis-ci.org/sockjs/sockjs-client)[![Dependencies](https://img.shields.io/david/sockjs/sockjs-client.svg?style=flat-square)](https://david-dm.org/sockjs/sockjs-client)[![Chat](https://img.shields.io/badge/Chat-gitter.im-blue.svg?style=flat-square)](https://gitter.im/sockjs/sockjs-client)
[![Sauce Test Status](https://saucelabs.com/buildstatus/brycekahle)](https://saucelabs.com/u/brycekahle)
[![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=eHZFNERhNUo5L1FDVDFkZFQ1c1N6ejY1M1NHc3Vla0VwMVhIK3JPZG1hVT0tLWVxS2VRUVpDUDQ1RG5CaVFFTHl1K3c9PQ==--51192740c73a49422b14f14fee810fb7a8506f1f)](https://www.browserstack.com/automate/public-build/eHZFNERhNUo5L1FDVDFkZFQ1c1N6ejY1M1NHc3Vla0VwMVhIK3JPZG1hVT0tLWVxS2VRUVpDUDQ1RG5CaVFFTHl1K3c9PQ==--51192740c73a49422b14f14fee810fb7a8506f1f)
SockJS is a browser JavaScript library that provides a WebSocket-like
object. SockJS gives you a coherent, cross-browser, Javascript API
@@ -299,7 +299,7 @@ pass all the tests.
npm run test:browser_local
This will start [zuul](https://github.com/defunctzombie/zuul) and a test support server. Open the browser to [http://localhost:9090/_zuul](http://localhost:9090/_zuul) and watch the tests run.
This will start [karma](https://karma-runner.github.io) and a test support server.
Browser Quirks
--------------
View
@@ -5,14 +5,7 @@ if [ "x${BROWSER}" = "x" ]; then
npm run lint
npm test
elif [ "${TRAVIS_SECURE_ENV_VARS}" = "true" ]; then
npm run test:bundle
if [ "x${BROWSER_NAME}" = "x" ]; then
./node_modules/.bin/zuul tests/browser.js
elif [ "x${BROWSER_PLATFORM}" = "x" ]; then
./node_modules/.bin/zuul --browser-name $BROWSER_NAME --browser-version $BROWSER_VERSION tests/browser.js
else
./node_modules/.bin/zuul --browser-name $BROWSER_NAME --browser-version $BROWSER_VERSION --browser-platform "$BROWSER_PLATFORM" tests/browser.js
fi
npm run test:browser_remote
else
exit 1
fi
View
@@ -0,0 +1,99 @@
// Karma configuration
// Generated on Tue Aug 07 2018 16:41:49 GMT-0400 (EDT)
const testServer = require('./tests/support/sockjs_server');
const targets = require('./tests/browser_targets');
const port = 9889;
var SockFrameworkFactory = function(config, logger) {
const log = logger.create('sockjs.server');
log.info('Starting sockjs test server...');
testServer(port, config);
};
module.exports = function(config) {
config.set({
// necessary to have karma proxy websockets correctly
urlRoot: '/karma/',
client: {
useIframe: false,
runInParent: true
},
plugins: [
{'framework:sock': ['factory', SockFrameworkFactory]},
'karma-*'
],
// 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: ['sock', 'mocha', 'browserify'],
// list of files / patterns to load in the browser
files: [
{ pattern: 'tests/support/domain.js', watched: false, nocache: true },
{ pattern: 'tests/browser.js', watched: false }
],
// list of files / patterns to exclude
exclude: [
],
proxies: {
'/sockjs-test/': 'http://localhost:' + port + '/'
},
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'tests/browser.js': ['browserify']
},
browserify: {
debug: true
},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress', 'BrowserStack'],
// 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: false,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: Object.keys(targets),
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,
// Concurrency level
// how many browser should be started simultaneous
concurrency: 5,
browserStack: {
username: 'brycekahle2',
accessKey: process.env.BROWSERSTACK_ACCESS_KEY,
forcelocal: true,
video: false,
project: 'sockjs-client'
},
customLaunchers: targets,
})
}
Oops, something went wrong.

0 comments on commit 60f5599

Please sign in to comment.