Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fixes combo warm cache test by re-ordering cache loading and combineScripts() call #112

Merged
merged 3 commits into from

2 participants

@noahadams
Owner

..., it is unclear to me why this has been passing with phantomjs

@b1tr0t
Owner

@noahadams Was there actually a regression of some kind on warm cache? Or did someone just notice the test was passing and shouldn't have?

@b1tr0t b1tr0t merged commit 57c75ef into from
@noahadams
Owner

I noticed that this was consistently failing in chrome, but with good reason (the main thing is the call to combineScripts before the cache had been reset), and that there was a failing request happening as a result (as the fallback for combo execution when the script is not present in its resources dictionary is to write out a script tag referencing the original src).

@tedtate tedtate deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 5, 2013
  1. @noahadams

    fixes combo warm cache test by adding a fixture that was somehow drop…

    noahadams authored
    …ped, it is unclear to me why this has been passing with phantomjs
  2. @noahadams

    remove un-needed fixture, hard-code urls to remind myself that these …

    noahadams authored
    …tests depend on an imaginary external resource
  3. @noahadams
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 6 deletions.
  1. +8 −6 tests/index.html
View
14 tests/index.html
@@ -63,9 +63,9 @@ <h2 id="qunit-userAgent"></h2>
<textarea id="combineScripts-1">
<script>var a = ['a']</script>
- <script x-src="push.js#b"></script>
+ <script x-src="http://should.be/cached/push.js#b"></script>
<script>a.push('c')</script>
- <script x-src="push.js#d"></script>
+ <script x-src="http://should.be/cached/push.js#d"></script>
</textarea>
<textarea id="combineScripts-2">
@@ -185,20 +185,22 @@ <h2 id="qunit-userAgent"></h2>
asyncTest('combo - Warm cache', 1, function() {
var cache = {
- 'http://127.0.0.1:1337/tests/push.js': {
+ 'http://should.be/cached/push.js': {
'headers': {'expires': UTC_TWO_WEEKS_FROM_NOW}
, 'status': 'ready'
- , 'url': 'http://127.0.0.1:1337/tests/push.js'
+ , 'url': 'http://should.be/cached/push.js'
, 'body': 'var scripts = [].slice.call(document.getElementsByTagName("script"));'
+ 'a.push(scripts[scripts.length - 2].innerHTML.split("#")[1][0]);'
, 'text': true
}
}
, $scripts = $($('#combineScripts-1').text())
- , $result = $scripts.combineScripts()
+ , $result
, html = '';
httpCache.reset(cache);
+ $result = $scripts.combineScripts();
+
httpCache.save(function(err) {
if (err) {
return;
@@ -226,7 +228,7 @@ <h2 id="qunit-userAgent"></h2>
iframe.document.write(html);
function load() {
- equal(iframe.window.a.length, 4, 'a = [a, b, c , d]');
+ deepEqual(iframe.window.a, ['a', 'b', 'c', 'd'], 'a = [a, b, c , d]');
start();
}
Something went wrong with that request. Please try again.