Skip to content
Browse files

use a timeout in the browser

  • Loading branch information...
1 parent 5cf848e commit 6c2a25c70308756cf09b2e04df45ad619c667151 @dominictarr committed Mar 13, 2013
Showing with 11 additions and 8 deletions.
  1. +11 −8 index.js
View
19 index.js
@@ -54,14 +54,17 @@ module.exports = function (stream, opts) {
//your test framework probably has assigned a listener for on exit also,
//make sure we are first. so the framework has a chance to detect a
//validation error.
- process.listeners('exit').unshift(function () {
- try {
- mac.validate()
- } catch (err) {
- console.error(err && err.stack)
- throw err
- }
- })
+ if(process.listeners)
+ process.listeners('exit').unshift(function () {
+ try {
+ mac.validate()
+ } catch (err) {
+ console.error(err && err.stack)
+ throw err
+ }
+ })
+ else
+ setTimeout(mac.validate, 10e3)
return this
}

0 comments on commit 6c2a25c

Please sign in to comment.
Something went wrong with that request. Please try again.