Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit19ced96

Browse files
authored
Tests: Allow statusText to be "success" in AJAX tests
In HTTP/2, status message is not supported and whatever is reported asstatusText differs between browsers. In Chrome & Safari it's "success", inFirefox & IE it's "OK". So far "success" wasn't allowed. This made the testspass locally if you're running an HTTP/1.1 server but on TestSwarm which isnow proxied via an HTTP/2-equipped Cloudflare, the relevant test started failingin Chrome & Safari.Allow "success" to resolve the issue.Closesgh-4973
1 parente23190e commit19ced96

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎test/unit/ajax.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1704,7 +1704,8 @@ QUnit.module( "ajax", {
17041704
vardone=assert.async();
17051705
jQuery.ajax(url("mock.php?action=status&code=200&text=Hello")).done(function(_,statusText,jqXHR){
17061706
assert.strictEqual(statusText,"success","callback status text ok for success");
1707-
assert.ok(jqXHR.statusText==="Hello"||jqXHR.statusText==="OK","jqXHR status text ok for success ("+jqXHR.statusText+")");
1707+
assert.ok(["Hello","OK","success"].indexOf(jqXHR.statusText)>-1,
1708+
"jqXHR status text ok for success ("+jqXHR.statusText+")");
17081709
jQuery.ajax(url("mock.php?action=status&code=404&text=World")).fail(function(jqXHR,statusText){
17091710
assert.strictEqual(statusText,"error","callback status text ok for error");
17101711
done();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp