Skip to content

Commit ced2d08

Browse files
authored
Merge pull request #1000 from bertdeblock/remove-use-of-core-object-for-utils
Remove use of `core-object` for utils
2 parents 399dba5 + 03adef4 commit ced2d08

2 files changed

Lines changed: 23 additions & 13 deletions

File tree

lib/utils/result-summary.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
'use strict';
22

3-
const CoreObject = require('core-object');
43
const chalk = require('chalk');
54
const Table = require('cli-table3');
65

7-
module.exports = CoreObject.extend({
6+
module.exports = class ResultSummary {
7+
constructor(options) {
8+
this.results = options.results;
9+
this.ui = options.ui;
10+
}
11+
812
print() {
913
let task = this;
1014
let colorAndMessage;
@@ -39,13 +43,15 @@ module.exports = CoreObject.extend({
3943

4044
task.ui.writeLine('');
4145
task._printResultsSummary(countFailed, countPassed, allowedFailCount, this.results.length);
42-
},
46+
}
47+
4348
_printResultHeader() {
4449
let task = this;
4550
task.ui.writeLine('');
4651
task.ui.writeLine('------ RESULTS ------');
4752
task.ui.writeLine('');
48-
},
53+
}
54+
4955
_printDependencyTable(dependencyStatus) {
5056
if (!dependencyStatus.length) {
5157
return;
@@ -80,7 +86,8 @@ module.exports = CoreObject.extend({
8086
});
8187
task.ui.writeLine(table);
8288
task.ui.writeLine('');
83-
},
89+
}
90+
8491
_printResultsSummary(countFailed, countPassed, allowedFailCount, total) {
8592
let task = this;
8693
if (countFailed) {
@@ -94,5 +101,5 @@ module.exports = CoreObject.extend({
94101
} else {
95102
task.ui.writeLine(chalk.green(`All ${countPassed} scenarios succeeded`));
96103
}
97-
},
98-
});
104+
}
105+
};

lib/utils/scenario-manager.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
'use strict';
22

3-
const CoreObject = require('core-object');
3+
module.exports = class ScenarioManager {
4+
constructor(options) {
5+
this.dependencyManagerAdapters = options.dependencyManagerAdapters;
6+
this.ui = options.ui;
7+
}
48

5-
module.exports = CoreObject.extend({
69
async setup() {
710
let { ui } = this;
811

912
for (let depManager of this.dependencyManagerAdapters) {
1013
await depManager.setup({ ui });
1114
}
12-
},
15+
}
1316

1417
async changeTo(scenario) {
1518
let results = [];
@@ -23,11 +26,11 @@ module.exports = CoreObject.extend({
2326
}
2427

2528
return results;
26-
},
29+
}
2730

2831
async cleanup() {
2932
for (let depManager of this.dependencyManagerAdapters) {
3033
await depManager.cleanup();
3134
}
32-
},
33-
});
35+
}
36+
};

0 commit comments

Comments
 (0)