saucie
v4.1.0
Published
A library which allows you to integrate results of your frontend JavaScript tests into a Sauce jobs results page.
Readme
saucie

This library allows you to integrate your javascript test results into a Sauce jobs results page.
It's available for running QUnit, Jasmine and Mocha tests through various browsers hosted on SauceLabs.
Instructions
- Get a SauceLabs account.
- Make sure Sauce credentials are set in env:
- SAUCE_USERNAME - your SauceLabs username
- SAUCE_ACCESS_KEY - your SauceLabs API/Access key.
- Run
testem ci --port 8080to run it on all the listed browsers - seetestem launchersfor the full list.- It will take a while at the first time. This will only happen once to download the Sauce Connect binary
Sauce Connect tunnel options
saucie.connect(opts) starts Sauce Connect and waits for local readiness at http://localhost:<readinessPort>/readyz (default port 8032).
The tunnel name defaults to $GITHUB_RUN_ID, or 'saucie' when that variable is unset. The CLI accepts the same default via --tunnel-identifier / -t.
For short-lived parent processes (for example Testem on_start hooks), pass:
detached: true— spawn Sauce Connect detached withstdio: 'ignore'andunref()after all readiness checks pass so the tunnel survives hook exitwaitForApiReady: true— also poll the Sauce Labs tunnels API until the tunnel with matchingtunnelIdentifierhasis_ready: truepidfile: 'sc_client.pid'— write the Sauce Connect process id after both readiness checks pass; use withsaucie.disconnect(pidfile)in anon_exithook
Optional tuning: apiReadyMaxRetries (default 120) and apiReadyInterval (default 1000 ms).
Example:
var saucie = require('saucie');
saucie.connect({
username: process.env.SAUCE_USERNAME,
accessKey: process.env.SAUCE_ACCESS_KEY,
logger: console.log,
pidfile: 'sc_client.pid',
detached: true,
waitForApiReady: true,
}).then(function () {
process.exit(0);
});Disconnect
saucie.disconnect(pidfile) reads the pid written by connect({ pidfile }), sends SIGTERM, waits for the process to exit, and removes the pid file. Missing or stale pid files are ignored so teardown does not fail after tests complete.
