diff --git a/lib/utils/result-summary.js b/lib/utils/result-summary.js index 1c88baf1..36d419ce 100644 --- a/lib/utils/result-summary.js +++ b/lib/utils/result-summary.js @@ -1,10 +1,14 @@ 'use strict'; -const CoreObject = require('core-object'); const chalk = require('chalk'); const Table = require('cli-table3'); -module.exports = CoreObject.extend({ +module.exports = class ResultSummary { + constructor(options) { + this.results = options.results; + this.ui = options.ui; + } + print() { let task = this; let colorAndMessage; @@ -39,13 +43,15 @@ module.exports = CoreObject.extend({ task.ui.writeLine(''); task._printResultsSummary(countFailed, countPassed, allowedFailCount, this.results.length); - }, + } + _printResultHeader() { let task = this; task.ui.writeLine(''); task.ui.writeLine('------ RESULTS ------'); task.ui.writeLine(''); - }, + } + _printDependencyTable(dependencyStatus) { if (!dependencyStatus.length) { return; @@ -80,7 +86,8 @@ module.exports = CoreObject.extend({ }); task.ui.writeLine(table); task.ui.writeLine(''); - }, + } + _printResultsSummary(countFailed, countPassed, allowedFailCount, total) { let task = this; if (countFailed) { @@ -94,5 +101,5 @@ module.exports = CoreObject.extend({ } else { task.ui.writeLine(chalk.green(`All ${countPassed} scenarios succeeded`)); } - }, -}); + } +}; diff --git a/lib/utils/scenario-manager.js b/lib/utils/scenario-manager.js index 8882caa7..9084d2fe 100644 --- a/lib/utils/scenario-manager.js +++ b/lib/utils/scenario-manager.js @@ -1,15 +1,18 @@ 'use strict'; -const CoreObject = require('core-object'); +module.exports = class ScenarioManager { + constructor(options) { + this.dependencyManagerAdapters = options.dependencyManagerAdapters; + this.ui = options.ui; + } -module.exports = CoreObject.extend({ async setup() { let { ui } = this; for (let depManager of this.dependencyManagerAdapters) { await depManager.setup({ ui }); } - }, + } async changeTo(scenario) { let results = []; @@ -23,11 +26,11 @@ module.exports = CoreObject.extend({ } return results; - }, + } async cleanup() { for (let depManager of this.dependencyManagerAdapters) { await depManager.cleanup(); } - }, -}); + } +};