Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function runTests(cb) {
browserstack.run({
username: BS_USERNAME,
key: BS_KEY,
test_path: "test/SpecRunner.html",
test_framework: "jasmine2",
test_server_port: 8081,
browsers: browsers
}, function (err, reports) {
if (err) {
return cb(err);
}
// Enable to see full report
// console.log(JSON.stringify(reports, null, 2));
console.log("Test Finished");
console.log("");
var browserstackRunner = require('browserstack-runner');
var config = require('./browserstack.json');
browserstackRunner.run(config, function(error, report) {
for (var i = 0; i < report.length; i++) {
var err = report[i].suites.status;
if (err === 'failed') {
process.exitCode = 1;
return
}
}
});