Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: remove unused function arguments in params #5124

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
lint: remove unused function arguments in tests
closes #5124
  • Loading branch information
raksbisht authored and dougwilson committed Feb 21, 2023
commit c6ee8d6e7f11c3ac6bdda8e1bd4c1e38445f2d22
2 changes: 1 addition & 1 deletion test/Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ describe('Router', function(){
it('should handle throwing inside routes with params', function(done) {
var router = new Router();

router.get('/foo/:id', function(req, res, next){
router.get('/foo/:id', function () {
throw new Error('foo');
});

Expand Down
6 changes: 3 additions & 3 deletions test/app.param.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ describe('app', function(){
app.get('/:user', function(req, res, next) {
next('route');
});
app.get('/:user', function(req, res, next) {
app.get('/:user', function (req, res) {
res.send(req.params.user);
});

Expand All @@ -187,11 +187,11 @@ describe('app', function(){
next(new Error('invalid invocation'))
});

app.post('/:user', function(req, res, next) {
app.post('/:user', function (req, res) {
res.send(req.params.user);
});

app.get('/:thing', function(req, res, next) {
app.get('/:thing', function (req, res) {
res.send(req.thing);
});

Expand Down
22 changes: 11 additions & 11 deletions test/app.router.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('app.router', function(){
it('should decode correct params', function(done){
var app = express();

app.get('/:name', function(req, res, next){
app.get('/:name', function (req, res) {
res.send(req.params.name);
});

Expand All @@ -102,7 +102,7 @@ describe('app.router', function(){
it('should not accept params in malformed paths', function(done) {
var app = express();

app.get('/:name', function(req, res, next){
app.get('/:name', function (req, res) {
res.send(req.params.name);
});

Expand All @@ -114,7 +114,7 @@ describe('app.router', function(){
it('should not decode spaces', function(done) {
var app = express();

app.get('/:name', function(req, res, next){
app.get('/:name', function (req, res) {
res.send(req.params.name);
});

Expand All @@ -126,7 +126,7 @@ describe('app.router', function(){
it('should work with unicode', function(done) {
var app = express();

app.get('/:name', function(req, res, next){
app.get('/:name', function (req, res) {
res.send(req.params.name);
});

Expand Down Expand Up @@ -910,7 +910,7 @@ describe('app.router', function(){
next();
});

app.get('/bar', function(req, res){
app.get('/bar', function () {
assert(0);
});

Expand All @@ -919,7 +919,7 @@ describe('app.router', function(){
next();
});

app.get('/foo', function(req, res, next){
app.get('/foo', function (req, res) {
calls.push('/foo 2');
res.json(calls)
});
Expand All @@ -939,7 +939,7 @@ describe('app.router', function(){
next('route')
}

app.get('/foo', fn, function(req, res, next){
app.get('/foo', fn, function (req, res) {
res.end('failure')
});

Expand All @@ -964,11 +964,11 @@ describe('app.router', function(){
next('router')
}

router.get('/foo', fn, function (req, res, next) {
router.get('/foo', fn, function (req, res) {
res.end('failure')
})

router.get('/foo', function (req, res, next) {
router.get('/foo', function (req, res) {
res.end('failure')
})

Expand All @@ -995,7 +995,7 @@ describe('app.router', function(){
next();
});

app.get('/bar', function(req, res){
app.get('/bar', function () {
assert(0);
});

Expand All @@ -1004,7 +1004,7 @@ describe('app.router', function(){
next(new Error('fail'));
});

app.get('/foo', function(req, res, next){
app.get('/foo', function () {
assert(0);
});

Expand Down
4 changes: 2 additions & 2 deletions test/res.format.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ app3.use(function(req, res, next){

var app4 = express();

app4.get('/', function(req, res, next){
app4.get('/', function (req, res) {
res.format({
text: function(){ res.send('hey') },
html: function(){ res.send('<p>hey</p>') },
Expand Down Expand Up @@ -155,7 +155,7 @@ describe('res', function(){
var app = express();
var router = express.Router();

router.get('/', function(req, res, next){
router.get('/', function (req, res) {
res.format({
text: function(){ res.send('hey') },
html: function(){ res.send('<p>hey</p>') },
Expand Down