2016-01-25 11:05:01 +01:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const colors = require('colors');
|
|
|
|
const sauceConnectLauncher = require('sauce-connect-launcher');
|
2016-06-02 16:42:20 +02:00
|
|
|
const config = require('./config'); // eslint-disable-line no-unused-vars
|
2016-01-25 11:05:01 +01:00
|
|
|
|
|
|
|
|
|
|
|
function connect() {
|
2016-06-02 16:42:20 +02:00
|
|
|
console.log(
|
|
|
|
colors.yellow('Setting up tunnel from Saucelabs to your lovely computer, will take a while.')
|
|
|
|
);
|
2016-01-25 11:05:01 +01:00
|
|
|
// Creating the tunnel takes a bit of time. For this case we can safely disable Mocha timeouts.
|
|
|
|
|
2016-06-02 16:42:20 +02:00
|
|
|
sauceConnectLauncher((err) => {
|
2016-01-25 11:05:01 +01:00
|
|
|
if (err) {
|
|
|
|
console.error(err.message);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
console.log(colors.green('Connected! Keep this process running and execute your tests.'));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
if (require.main === module) {
|
|
|
|
connect();
|
|
|
|
}
|