Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var remote = require('remote');
var app = remote.require('app');
var pkgJson = require('../../../package.json');
// Start the crash reporter before anything else
require('crash-reporter').start({
productName: pkgJson.name,
companyName: 'atom-shell-starter'
});
var specRootPath = path.resolve(__dirname, '..');
if (global.loadSettings.exitWhenDone) {
var jasmineFn = require('jasmine');
jasmineFn(global.jasmine);
var reporter = new jasmineFn.ConsoleReporter({
print: function (str) {
process.stderr.write(str);
},
onComplete: function (allPassed) {
return app.exit(allPassed ? 0 : 1);
}
});
var jasmineEnv = jasmine.getEnv();
jasmineEnv.addReporter(reporter);
fs.listTreeSync(specRootPath).forEach(function (specFilePath) {
if (/-spec\.js$/.test(specFilePath)) {
require(specFilePath);
}
});
jrunner.configureDefaultReporter({showColors: true});
jrunner.onComplete(function(passed) {
if (!passed) {
var err = new Error('Jasmine node tests failed.');
// The stack is not useful in this context.
err.showStack = false;
cb(err);
} else {
cb();
}
});
jrunner.print = function(value) {
process.stdout.write(value);
};
jrunner.addReporter(new JasmineRunner.ConsoleReporter(jrunner));
jrunner.projectBaseDir = __dirname;
jrunner.specDir = '';
jrunner.addSpecFiles(specFiles);
jrunner.execute();
}
var fs = require('fs-plus');
var path = require('path');
var electron = require('electron');
var app = electron.remote.app;
var newLine = require('os').EOL;
var specRootPath = path.resolve(__dirname, '..');
if (global.loadSettings.exitWhenDone) {
var jasmineFn = require('jasmine');
jasmineFn(global.jasmine);
var out = '';
var reporter = new jasmineFn.ConsoleReporter({
print: function (str) {
if (str === newLine) {
electron.remote.getGlobal('console').log(out);
out = '';
return;
}
out += str;
},
onComplete: function (allPassed) {
return app.exit(allPassed ? 0 : 1);
}
});
var jasmineEnv = jasmine.getEnv();
jasmineEnv.addReporter(reporter);