From 94b3fff01d91cdfa4ae4b88da63331939b5b6fbc Mon Sep 17 00:00:00 2001 From: Jon Church Date: Mon, 29 Apr 2024 15:20:38 -0400 Subject: [PATCH 1/2] skip query method test related: #5615 --- test/app.router.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/app.router.js b/test/app.router.js index 12b6c1fa519..9a405fae266 100644 --- a/test/app.router.js +++ b/test/app.router.js @@ -37,6 +37,10 @@ describe('app.router', function(){ describe('methods', function(){ methods.concat('del').forEach(function(method){ if (method === 'connect') return; + // Temporarily excluding this test, can gate behind supported Node version when one exists + // upstream tracking https://github.com/nodejs/node/pull/51719 + // express tracking issue: https://github.com/expressjs/express/issues/5615 + if (method === 'query') return; it('should include ' + method.toUpperCase(), function(done){ var app = express(); From 177a0cf8d0f957df03527374a960177c9b250087 Mon Sep 17 00:00:00 2001 From: Jon Church Date: Thu, 2 May 2024 01:39:48 -0400 Subject: [PATCH 2/2] update to only skip query on 21 and 22 --- test/app.router.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/test/app.router.js b/test/app.router.js index 9a405fae266..d9ddc69afc5 100644 --- a/test/app.router.js +++ b/test/app.router.js @@ -35,12 +35,25 @@ describe('app.router', function(){ }) describe('methods', function(){ - methods.concat('del').forEach(function(method){ - if (method === 'connect') return; - // Temporarily excluding this test, can gate behind supported Node version when one exists + function getMajorVersion(versionString) { + return versionString.split('.')[0]; + } + + function shouldSkipQuery(versionString) { + // Temporarily skipping this test on 21 and 22 + // update this implementation to run on those release lines on supported versions once they exist // upstream tracking https://github.com/nodejs/node/pull/51719 // express tracking issue: https://github.com/expressjs/express/issues/5615 - if (method === 'query') return; + var majorsToSkip = { + "21": true, + "22": true + } + return majorsToSkip[getMajorVersion(versionString)] + } + + methods.concat('del').forEach(function(method){ + if (method === 'connect') return; + if (method === 'query' && shouldSkipQuery(process.versions.node)) return it('should include ' + method.toUpperCase(), function(done){ var app = express();