From 3c7dcb0cd8081f2b1e396f87569cc806f0091f30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Thu, 18 Nov 2021 15:45:51 +0100 Subject: [PATCH] Tests: Skip ETag AJAX tests on TestSwarm TestSwarm is now proxied via Cloudflare which cuts out headers relevant for ETag tests, failing them. We're still running those tests in Karma on Chrome & Firefox (including Firefox ESR). --- test/unit/ajax.js | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 4ab17e8eb5..081798a8dd 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -1634,12 +1634,25 @@ QUnit.module( "ajax", { function( label, cache ) { jQuery.each( { - "If-Modified-Since": "mock.php?action=ims", - "Etag": "mock.php?action=etag" + "If-Modified-Since": { + url: "mock.php?action=ims", + qunitMethod: "test" + }, + "Etag": { + url: "mock.php?action=etag", + + // Support: TestSwarm + // TestSwarm is now proxied via Cloudflare which cuts out + // headers relevant for ETag tests, failing them. We're still + // running those tests in Karma on Chrome & Firefox (including + // Firefox ESR). + qunitMethod: QUnit.isSwarm ? "skip" : "test" + } }, - function( type, url ) { - url = baseURL + url + "&ts=" + ifModifiedNow++; - QUnit.test( "jQuery.ajax() - " + type + " support" + label, function( assert ) { + function( type, data ) { + var url = baseURL + data.url + "&ts=" + ifModifiedNow++; + QUnit[ data.qunitMethod ]( "jQuery.ajax() - " + type + + " support" + label, function( assert ) { assert.expect( 4 ); var done = assert.async(); jQuery.ajax( {