Skip to content
This repository was archived by the owner on Nov 4, 2025. It is now read-only.

Added event handler to process the stream end signal - #34

Open
jmhomedes-ob wants to merge 1 commit into
SC5:masterfrom
jmhomedes:stream-end-signal
Open

Added event handler to process the stream end signal#34
jmhomedes-ob wants to merge 1 commit into
SC5:masterfrom
jmhomedes:stream-end-signal

Conversation

@jmhomedes-ob

Copy link
Copy Markdown
Contributor

Added call to "done()" function in order to close ended stream and propagate error signal, if it applies, to CI systems like Jenkins.

Comment thread src/index.es6
});
runTestsPromise.done(result => {
serverProcess.on('close', () => {
setTimeout(function(){

@jmhomedes-ob jmhomedes-ob Sep 8, 2017

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

callback() is called inside a timeout because I detected that when it's called with an error it interrupts de generation of HTML gemini report. It's working this way, but I'm sure the code is improveable and reviews/suggestions accepted.

Now you can update documentation by naming that with this change users will be able to do:

gulp
.src('src', { read: false })
.pipe(visTest.test({
    ...
}))
.on('end', function(){
    // will execute allways
})
.on('error', function(error){
    // will execute only when error signal (some test has failed)
});

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants