Permalink
Browse files

Allow testing against multiple versions of Ember & jQuery.

* Adds ability to test against multiple versions of Ember via the
  `emberchannel` query param (defaults to local Bower version).
* Adds ability to test against multiple jQuery versions via the `jquery`
  query param (defaults to local Bower version).
  • Loading branch information...
rwjblue committed Jan 29, 2014
1 parent 7335d43 commit fec5fc853dfaf037e229e081e6b444f53dc0eb42
Showing with 44 additions and 9 deletions.
  1. +44 −9 tests/index.html
View
@@ -4,18 +4,53 @@
<meta charset="utf-8">
<title>Ember Data</title>
<link rel="stylesheet" href="/bower_components/qunit/qunit/qunit.css">
+ <script src="/bower_components/qunit/qunit/qunit.js"></script>
+ <script src="/tests/qunit_configuration.js"></script>
+ <script src="/bower_components/handlebars/handlebars.js"></script>
+
+ <script type="text/javascript">
+ window.loadScript = function(url) {
+ document.write(unescape('%3Cscript src="'+url+'"%3E%3C/script%3E'));
+ };
+ </script>
+
+ <script type="text/javascript">
+ // Load custom version of jQuery if possible (assign to window so IE8 can use in later blocks)
+ var jQueryVersion = QUnit.urlParams.jquery;
+ if (jQueryVersion) {
+ loadScript('https://code.jquery.com/jquery-'+jQueryVersion+'.js');
+ }
+ // Close the script tag to make sure document.write happens
+ </script>
+
+ <script type="text/javascript">
+ // Fallback to default jQuery
+ if (jQueryVersion !== 'none' && !window.jQuery) {
+ loadScript('/bower_components/jquery/jquery.js');
+ }
+ // Close the script tag to make sure document.write happens
+ </script>
+
+ <script src="/tests/ember_configuration.js"></script>
+
+ <script type="text/javascript">
+ var emberChannel = QUnit.urlParams.emberchannel || "release", emberPath;
+
+ if (emberChannel === "release") {
+ emberPath = "/bower_components/ember/ember.js";
+ } else {
+ emberPath = 'https://s3.amazonaws.com/builds.emberjs.com/' + emberChannel + '/ember.js';
+ }
+
+ loadScript(emberPath);
+ </script>
+
+ <script src="/dist/ember-data.js"></script>
+ <script src="/tests/ember-data-setup.js"></script>
+ <script src="/tmp/tests.js"></script>
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
- <script src="/bower_components/jquery/jquery.js"></script>
- <script src="/bower_components/handlebars/handlebars.js"></script>
- <script src="/bower_components/qunit/qunit/qunit.js"></script>
- <script src="/tests/ember_configuration.js"></script>
- <script src="/bower_components/ember/ember.js"></script>
- <script src="/dist/ember-data.js"></script>
- <script src="/tests/ember-data-setup.js"></script>
- <script src="/tests/qunit_configuration.js"></script>
- <script src="/tmp/tests.js"></script>
</body>
</html>

0 comments on commit fec5fc8

Please sign in to comment.