1
0
mirror of https://github.com/ascribe/onion.git synced 2025-01-03 10:25:08 +01:00
onion/test/setup.js
2015-12-19 17:40:53 +01:00

34 lines
828 B
JavaScript

'use strict';
require('dotenv').load();
const sauceConnectLauncher = require('sauce-connect-launcher');
let globalSauceProcess;
if (process.env.SAUCE_AUTO_CONNECT) {
before(function(done) {
// Creating the tunnel takes a bit of time. For this case we can safely disable it.
this.timeout(0);
sauceConnectLauncher(function (err, sauceConnectProcess) {
if (err) {
console.error(err.message);
return;
}
globalSauceProcess = sauceConnectProcess;
done();
});
});
after(function (done) {
// Creating the tunnel takes a bit of time. For this case we can safely disable it.
this.timeout(0);
if (globalSauceProcess) {
globalSauceProcess.close(done);
}
});
}