JSUnitSaucelabs
Allows you to run your unit tests through Sauce Labs API without Grunt.
Used by
If you want to add your project here do not hesitate to open a PR 😉
Install
npm install jsunitsaucelabs --save-dev
Methods
Constructor
JSUnitSaucelabs constructor accepts the following parameters (the following are the default values):
username: null password: null tunneled: true build: null verbose: false verboseMode: null // accept : "debug", "info", "warn" hostname: 'saucelabs.com' base: '/rest/v1/'
JSUnitSaucelabs.prototype.initTunnel
This method allows you to initialise a tunnel between you and Sauce Labs, when this tunnel is started,
JSUnitSaucelabs will emit tunnelCreated
event
JSUnitSaucelabs inherit from
EventEmitter
JSUnitSaucelabs.prototype.start
This method uses :username/js-tests
from Sauce Labs API.
See here.
Parameters
platforms
: Array of platformsurl
: should point to the page that hosts your testsframework
: the framework used for your tests (QUnit, Jasmine, ...)callback
: function to handle error or successcallback(error, result)
If you use a tunnel between Sauce Labs and you, you shouldn't call start before the connection is established (see
initTunnel
method)
JSUnitSaucelabs.prototype.getStatus
This method uses :username/js-tests/status
from Sauce Labs API.
See here.
Parameters
taskIds
: Array of task IDs returned by Sauce Labs APIcallback
: function to handle error or successcallback(error, result)
JSUnitSaucelabs.prototype.stop
Allows you to stop the tunnel between you and Sauce Labs
Usage Example
var JSUnitSaucelabs = var jsUnitSaucelabs = username: 'your-saucelabs-username' password: 'your-saucelabs-api-key' var testURL = 'http://localhost/index.html?hidepassed' jsUnitSaucelabs jsUnitSaucelabs