errorEvent(...args: string[]): this { const errorEvents = this.opts.errorEvents = this.opts.errorEvents || []; su.flattenDeep([Array.from(arguments)]).forEach(function (v) { assert(v, 'Value was going to be added to "errorEvents", but value is falsy'); assert.equal(typeof v, 'string', 'Value for "errorEvent" must be a string.'); errorEvents.push(v); }); return this; }
sumanReporterFns.forEach(function (fn) { const reporterPath = fn.reporterPath; sr.push(reporterPath); reporterRets.push(fn.call(null, rb, optsCopy, {})); su.vgt(5) && reporterPath && _suman.log.info(`Loaded reporter with path: "${reporterPath}"`); });
process.once('uncaughtException', function (e: IPseudoError) { debugger; // leave debugger statement here please _suman.log.error(`${chalk.magenta('Suman runner "uncaughtException" event:')} \n ${chalk.bold(su.getCleanErrorString(e))}`); process.exit(1); });
d.run(() => { changeCWDToRootOrTestDir(projectRoot); if (sumanOpts.rand) { files = shuffle(files); } _suman.sumanSingleProcessStartTime = Date.now(); require('./run-child-not-runner').run(su.removeSharedRootPath(files)); })
n.stdout.pipe(getTapJSONParser()) .on('error', function (e: Error) { _suman.log.error('error parsing TAP-JSON output =>', su.getCleanErrorString(e)); });
su.flattenDeep([sumanOpts.require]).filter(v => v).forEach(function (s) { String(s).split(',') .map(v => String(v).trim()) .filter(v => v) .forEach(requireFile); });
su.findSumanMarkers([ '@run.sh', '@transform.sh', '@config.json' ], testDir, getFilesToRun.files, function (err: Error, map: any) { if (err) { return cb(err); } _suman.markersMap = map; cb(null); });
let onError = function (e: Error) { _suman.log.error('\n', su.getCleanErrorString(e), '\n'); }
n.stdout.pipe(getTapParser()) .on('error', function (e: Error) { _suman.log.error('error parsing TAP output =>', su.getCleanErrorString(e)); }) .once('finish', function () { n.tapOutputIsComplete = true; process.nextTick(function () { n.emit('tap-output-is-complete', true); }); });
su.flattenDeep([sumanOpts.reporter_paths || []]).filter(v => { !v && _suman.log.warning('warning: a supposed filesystem path to a reporter was falsy.'); return v; }) .forEach(function (item: string) { if (!path.isAbsolute(item)) (item = path.resolve(projectRoot + '/' + item)); loadReporterViaPath(item); });
successEvents(...args: (string | Array<string>)[]): this { const successEvents = this.opts.successEvents = this.opts.successEvents || []; su.flattenDeep([args]).forEach(function (v) { assert(v, 'Value was going to be added to "successEvents", but value is falsy'); assert.equal(typeof v, 'string', 'Value for "successEvent" must be a string.'); successEvents.push(v); }); return this; }
process.on('error', function (e: Error) { debugger; // please leave it here, thx _suman.log.error(su.getCleanErrorString(e)); });
events(): this { const successEvents = this.opts.successEvents = this.opts.successEvents || []; su.flattenDeep([Array.from(arguments)]).forEach(function (v) { assert(v, 'Value was going to be added to "successEvents", but value is falsy'); assert.equal(typeof v, 'string', 'Value for "successEvent" must be a string.'); successEvents.push(v); }); return this; }
successEvent(...args: string[]): this { const successEvents = this.opts.successEvents = this.opts.successEvents || []; su.flattenDeep([Array.from(arguments)]).forEach(function (v) { assert(v, 'Value was going to be added to "successEvents", but value is falsy'); assert.equal(typeof v, 'string', 'Value for "successEvent" must be a string.'); successEvents.push(v); }); return this; }
errorEvents(...args: (Array<string> | string)[]): this { const errorEvents = this.opts.errorEvents = this.opts.errorEvents || []; su.flattenDeep([Array.from(arguments)]).forEach(function (v) { assert(v, 'Value was going to be added to "errorEvents", but value is falsy'); assert.equal(typeof v, 'string', 'Value for "errorEvent" must be a string.'); errorEvents.push(v); }); return this; }