-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
53 lines (42 loc) · 1.37 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
var HelloReporter = function(baseReporterDecorator, config, logger, helper, formatError) {
var log = logger.create('reporter.hello');
var helloConfig = config.helloReporter || {};
baseReporterDecorator(this);
this.adapters = [function(msg) {
process.stdout.write.bind(process.stdout)(msg + "\r\n");
}];
this.onRunStart = function(browsers) {
this.write("Hello World");
this.write(browsers);
};
this.onBrowserStart = function(browser) {
this.write("Hello " + browser.name);
this.write(browser);
};
this.onRunComplete = function(browsersCollection, results) {
this.write(results);
this.write("GoodBye World");
};
this.specSuccess = function(browser, result) {
this.write(helloConfig.successMsg);
}
this.specFailure = function(browser, result) {
this.write(helloConfig.failureMsg);
};
this.onSpecComplete = function(browser, result) {
this.write(result);
if (result.skipped) {
this.specSkipped(browser, result);
} else if (result.success) {
this.specSuccess(browser, result);
} else {
this.specFailure(browser, result);
}
this.write(result.description);
}
};
HelloReporter.$inject = ['baseReporterDecorator', 'config', 'logger', 'helper', 'formatError'];
// PUBLISH DI MODULE
module.exports = {
'reporter:hello': ['type', HelloReporter]
};