Skip to content

Commit

Permalink
update to only skip query on 21 and 22
Browse files Browse the repository at this point in the history
  • Loading branch information
jonchurch committed May 2, 2024
1 parent 94b3fff commit 177a0cf
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions test/app.router.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 177a0cf

Please sign in to comment.