From cd49171ebdc218ec08a19cbbcc8778dca1846098 Mon Sep 17 00:00:00 2001 From: Wes Todd Date: Thu, 12 Sep 2024 13:21:12 -0500 Subject: [PATCH] fix(test): add test for method routes without paths #5955 --- test/app.router.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/app.router.js b/test/app.router.js index 8e427bd6dc..79db75d10d 100644 --- a/test/app.router.js +++ b/test/app.router.js @@ -55,6 +55,17 @@ describe('app.router', function(){ .expect(200, done) }) + it('should not support ' + method.toUpperCase() + ' without a path', function () { + if (method === 'get' || (method === 'query' && shouldSkipQuery(process.versions.node))) { + this.skip(); + } + var app = express(); + + assert.throws(() => { + app[method](function (req, res) { }); + }); + }); + it('should reject numbers for app.' + method, function(){ var app = express(); assert.throws(app[method].bind(app, '/', 3), /Number/)