Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added event handler to process the stream end signal #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jmhomedes-ob
Copy link
Contributor

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

@@ -130,6 +130,15 @@ module.exports.test = function(options) {
tempDir: options.reportDir
});
runTestsPromise.done(result => {
serverProcess.on('close', () => {
setTimeout(function(){
Copy link
Contributor Author

@jmhomedes-ob jmhomedes-ob Sep 8, 2017

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants