1
0
mirror of https://github.com/ascribe/onion.git synced 2024-07-01 06:02:12 +02:00
onion/test/setup.js

34 lines
828 B
JavaScript
Raw Normal View History

2015-12-19 17:40:53 +01:00
'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);
}
});
}