Code cleanup
This commit is contained in:
committed by
Robin North
parent
57aed828ac
commit
6fb509a021
@@ -18,8 +18,8 @@ if (!("responseURL" in XMLHttpRequest.prototype)) {
|
||||
tape("test aborting xhr request", function(t) {
|
||||
var requestCacheBust = sendRequest.bind({
|
||||
options: {
|
||||
cacheBust: true,
|
||||
},
|
||||
cacheBust: true
|
||||
}
|
||||
})
|
||||
|
||||
t.test("- pending request is aborted", function(t) {
|
||||
|
||||
@@ -80,12 +80,11 @@ tape("test attach form preventDefaulted events", function(t) {
|
||||
tape("test options are not modified by attachForm", function(t) {
|
||||
var form = document.createElement("form")
|
||||
var options = {foo: "bar"}
|
||||
var loadUrl = () => {}
|
||||
var loadUrl = function() {}
|
||||
|
||||
attachForm.call({options, loadUrl}, form)
|
||||
attachForm.call({options: options, loadUrl: loadUrl}, form)
|
||||
|
||||
var internalUri = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search
|
||||
form.action = internalUri
|
||||
form.action = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search
|
||||
form.method = "GET"
|
||||
trigger(form, "submit")
|
||||
|
||||
|
||||
@@ -79,12 +79,11 @@ tape("test attach link preventDefaulted events", function(t) {
|
||||
tape("test options are not modified by attachLink", function(t) {
|
||||
var a = document.createElement("a")
|
||||
var options = {foo: "bar"}
|
||||
var loadUrl = () => {};
|
||||
var loadUrl = function() {};
|
||||
|
||||
attachLink.call({options, loadUrl}, a)
|
||||
attachLink.call({options: options, loadUrl: loadUrl}, a)
|
||||
|
||||
var internalUri = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search
|
||||
a.href = internalUri
|
||||
a.href = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search
|
||||
|
||||
trigger(a, "click")
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ tape("test xhr request", function(t) {
|
||||
t.test("- request is made, gets a result, and is cache-busted", function(t) {
|
||||
var requestCacheBust = sendRequest.bind({
|
||||
options: {
|
||||
cacheBust: true,
|
||||
},
|
||||
cacheBust: true
|
||||
}
|
||||
});
|
||||
var r = requestCacheBust(url, {}, function(result) {
|
||||
t.equal(r.responseURL.indexOf("?"), url.length, "XHR URL is cache-busted when configured to be")
|
||||
@@ -38,8 +38,8 @@ tape("test xhr request", function(t) {
|
||||
t.test("- request is not cache-busted when configured not to be", function(t) {
|
||||
var requestNoCacheBust = sendRequest.bind({
|
||||
options: {
|
||||
cacheBust: false,
|
||||
},
|
||||
cacheBust: false
|
||||
}
|
||||
});
|
||||
var r = requestNoCacheBust(url, {}, function() {
|
||||
t.equal(r.responseURL, url, "XHR URL is left untouched")
|
||||
|
||||
Reference in New Issue
Block a user