Skip to content

Commit

Permalink
fix(test): add test for method routes without paths #5955
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleytodd committed Sep 12, 2024
1 parent 7e562c6 commit cd49171
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/app.router.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
Expand Down

0 comments on commit cd49171

Please sign in to comment.