mirror of
https://github.com/openstf/stf
synced 2025-10-04 18:29:17 +02:00
Oops. Fix stupid error in lifecycle.
This commit is contained in:
parent
e0b4b3b40f
commit
941f4cb051
1 changed files with 8 additions and 6 deletions
|
@ -11,19 +11,21 @@ function Lifecycle() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Lifecycle.prototype.share = function(name, emitter, options) {
|
Lifecycle.prototype.share = function(name, emitter, options) {
|
||||||
_.defaults(options, {
|
var opts = _.assign({
|
||||||
end: true
|
end: true
|
||||||
, error: true
|
, error: true
|
||||||
})
|
}
|
||||||
|
, options
|
||||||
|
)
|
||||||
|
|
||||||
if (options.end) {
|
if (opts.end) {
|
||||||
emitter.on('end', function() {
|
emitter.on('end', function() {
|
||||||
log.fatal('%s ended; we shall share its fate', name)
|
log.fatal('%s ended; we shall share its fate', name)
|
||||||
this.fatal()
|
this.fatal()
|
||||||
}.bind(this))
|
}.bind(this))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.error) {
|
if (opts.error) {
|
||||||
emitter.on('error', function(err) {
|
emitter.on('error', function(err) {
|
||||||
log.fatal('%s had an error', name, err.stack)
|
log.fatal('%s had an error', name, err.stack)
|
||||||
this.fatal()
|
this.fatal()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue