While looking through the code in the protractor-jasmine2-screenshot-reporter npm package I noticed that it contains a beforeLaunch function, which is exported with the rest of the functions.
I know that the lifecycle stages run in the following order so my question is: How can this reporter ever possibly affect the beforeLaunch stage of the execution when the jasmine object itself isn't available until the onPrepare stage?
--- beforeLaunch
--- onPrepare (set in conf) ***reporters initialized here
--- jasmineStarted (set in reporter)
--- beforeAll
--- suiteStarted (set in reporter)
--- specStarted (set in reporter)
--- beforeEach (set in testFile)
+++ afterEach (set in testFile)
+++ specDone (set in reporter)
+++ suiteDone (set in reporter)
+++ afterAll
+++ jasmineDone (set in reporter)
+++ onComplete (set in conf)
+++ afterLaunch
Code from protractor-jasmine2-screenshot-reporter
function Jasmine2ScreenShotReporter(opts) {
this.beforeLaunch = function (callback) {
};
this.afterLaunch = function (callback) {
};
this.jasmineStarted = function (suiteInfo) {
};
this.suiteStarted = function (suite) {
};
this.suiteDone = function (suite) {
};
this.specStarted = function (spec) {
};
this.specDone = function (spec) {
};
this.jasmineDone = function () {
};
return this;
}
I possible I have fundamentally misunderstood some behavior here but hope someone can shed some light on this for me.