diff --git a/test/underscore.html b/test/underscore.html
index 2be2271e9..65e41f0ce 100644
--- a/test/underscore.html
+++ b/test/underscore.html
@@ -152,7 +152,7 @@
var reBasename = /[\w.-]+$/,
basePath = ('//' + location.host + location.pathname).replace(/\btest\/$/, ''),
modulePath = ui.buildPath.replace(/\.js$/, ''),
- locationPath = modulePath.replace(reBasename, ''),
+ locationPath = modulePath.replace(reBasename, '').replace(/\/$/, ''),
moduleMain = modulePath.match(reBasename)[0];
QUnit.config.autostart = false;