Skip to content

Commit 52d9781

Browse files
committed
fix(test): add test for method routes without paths #5955
1 parent fe93005 commit 52d9781

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/app.router.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,17 @@ describe('app.router', function(){
5555
.expect(200, done)
5656
})
5757

58+
it('should not support ' + method.toUpperCase() + ' without a path', function () {
59+
if (method === 'get' || (method === 'query' && shouldSkipQuery(process.versions.node))) {
60+
this.skip();
61+
}
62+
var app = express();
63+
64+
assert.throws(function () {
65+
app[method](function (req, res) { });
66+
});
67+
});
68+
5869
it('should reject numbers for app.' + method, function(){
5970
var app = express();
6071
assert.throws(app[method].bind(app, '/', 3), /Number/)

0 commit comments

Comments
 (0)