Experienced an issue where mocha throwing errors would cause things to not shut down. Also, there's a weird issue with invoking http from within a gulp task that can hold the response stream open and cause gulp to hang without exiting... so the selenium task has to force the stream on the HTTP query to end before hitting the callback.
This commit should resolve all issues with emitted errors either killing gulp before selenium can shut down (which causes issues on subsequent calls). There was also an issue with the selenium GET request's response locking gulp, causing successful or unsuccessful runs to prevent gulp from exiting.
I did remove comments from self-documenting functions (like runMocha commented with run mocha tests), added explicit returns on callbacks, and split a couple of functions to keep logic clean. Let me know if these don't fit the intended style and I'll make adjustments.
Experienced an issue where mocha throwing errors would cause things to not shut down. Also, there's a weird issue with invoking http from within a gulp task that can hold the response stream open and cause gulp to hang without exiting... so the selenium task has to force the stream on the HTTP query to end before hitting the callback.
This commit should resolve all issues with emitted errors either killing gulp before selenium can shut down (which causes issues on subsequent calls). There was also an issue with the selenium GET request's response locking gulp, causing successful or unsuccessful runs to prevent gulp from exiting.
I did remove comments from self-documenting functions (like
runMocha
commented withrun mocha tests
), added explicit returns on callbacks, and split a couple of functions to keep logic clean. Let me know if these don't fit the intended style and I'll make adjustments.