diff --git a/support/browser-entry.js b/support/browser-entry.js
index c711ce3e3a..25bf8491b2 100644
--- a/support/browser-entry.js
+++ b/support/browser-entry.js
@@ -119,6 +119,9 @@ mocha.ui = function(ui){
mocha.setup = function(opts){
if ('string' == typeof opts) opts = { ui: opts };
+ if ('delay' in opts) {
+ this.delay(opts.delay);
+ }
for (var opt in opts) this[opt](opts[opt]);
return this;
};
diff --git a/test/browser/delay.html b/test/browser/delay.html
new file mode 100644
index 0000000000..bdb92b8c23
--- /dev/null
+++ b/test/browser/delay.html
@@ -0,0 +1,29 @@
+
+
+ Mocha
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/browser/delay.js b/test/browser/delay.js
new file mode 100644
index 0000000000..aac35f9bc5
--- /dev/null
+++ b/test/browser/delay.js
@@ -0,0 +1,19 @@
+var delay = 500;
+var start = new Date().getTime();
+
+describe('delayed execution', function() {
+ it('should have waited ' + delay + 'ms to run this suite', function() {
+ assert(new Date().getTime() - delay >= start);
+ });
+});
+
+setTimeout(function() {
+ describe('delayed execution', function() {
+ it('should have no effect if attempted twice in the same suite', function() {
+ run();
+ assert(new Date().getTime() - delay < start + delay);
+ });
+ });
+
+ run();
+}, delay);