Skip to content

Commit 8e8b332

Browse files
committed
Merge pull request #10768 from rwjblue/add-live-reload
Add livereload to test suite.
2 parents e0a31ea + 9030e3f commit 8e8b332

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/index.html

+15
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@
116116
QUnit.config.urlConfig.push({ id: 'enableoptionalfeatures', label: "Enable Opt Features"});
117117
// Handle extending prototypes
118118
QUnit.config.urlConfig.push({ id: 'extendprototypes', label: 'Extend Prototypes'});
119+
// Enable/disable livereload
120+
QUnit.config.urlConfig.push({ id: 'livereload', label: 'Live Reload'});
119121
// Handle JSHint
120122
QUnit.config.urlConfig.push('nojshint');
121123
})();
@@ -138,6 +140,19 @@
138140
if (!QUnit.urlParams.nojshint && moduleName.match(/[-_.]jshint$/)) { Ember.__loader.require(moduleName); }
139141
}
140142
</script>
143+
144+
<script>
145+
if (QUnit.urlParams.livereload) {
146+
(function() {
147+
var src = (location.protocol || 'http:') + '//' + (location.hostname || 'localhost') + ':' + (parseInt(location.port, 10) + 31529) + '/livereload.js?snipver=1';
148+
var script = document.createElement('script');
149+
script.type = 'text/javascript';
150+
script.src = src;
151+
document.getElementsByTagName('head')[0].appendChild(script);
152+
}());
153+
}
154+
</script>
155+
141156
</head>
142157
<body>
143158
<div id="qunit"></div>

0 commit comments

Comments
 (0)