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

Commit7439e22

Browse files
committed
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(cherry picked from commit19ced96)
1 parentb39cfa1 commit7439e22

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
@@ -1627,7 +1627,8 @@ QUnit.module( "ajax", {
16271627
vardone=assert.async();
16281628
jQuery.ajax(url("mock.php?action=status&code=200&text=Hello")).done(function(_,statusText,jqXHR){
16291629
assert.strictEqual(statusText,"success","callback status text ok for success");
1630-
assert.ok(jqXHR.statusText==="Hello"||jqXHR.statusText==="OK","jqXHR status text ok for success ("+jqXHR.statusText+")");
1630+
assert.ok(["Hello","OK","success"].indexOf(jqXHR.statusText)>-1,
1631+
"jqXHR status text ok for success ("+jqXHR.statusText+")");
16311632
jQuery.ajax(url("mock.php?action=status&code=404&text=World")).fail(function(jqXHR,statusText){
16321633
assert.strictEqual(statusText,"error","callback status text ok for error");
16331634
done();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp