Skip to content

Commit

Permalink
test: remove unused params
Browse files Browse the repository at this point in the history
  • Loading branch information
vakhid-shagmanov committed Nov 12, 2023
1 parent 2a00da2 commit 4752d5e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/res.format.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ app1.use(function(req, res, next){
});
});

app1.use(function(err, req, res, next){
app1.use(function(err, req, res){
if (!err.types) throw err;
res.send(err.status, 'Supports: ' + err.types.join(', '));
})

var app2 = express();

app2.use(function(req, res, next){
app2.use(function(req, res){
res.format({
text: function(){ res.send('hey') },
html: function(){ res.send('<p>hey</p>') },
json: function(){ res.send({ message: 'hey' }) }
});
});

app2.use(function(err, req, res, next){
app2.use(function(err, req, res){
res.send(err.status, 'Supports: ' + err.types.join(', '));
})

Expand Down Expand Up @@ -69,13 +69,13 @@ app4.get('/', function (req, res) {
});
});

app4.use(function(err, req, res, next){
app4.use(function(err, req, res){
res.send(err.status, 'Supports: ' + err.types.join(', '));
})

var app5 = express();

app5.use(function (req, res, next) {
app5.use(function (req, res) {
res.format({
default: function () { res.send('hey') }
});
Expand All @@ -94,15 +94,15 @@ describe('res', function(){
describe('with parameters', function(){
var app = express();

app.use(function(req, res, next){
app.use(function(req, res){
res.format({
'text/plain; charset=utf-8': function(){ res.send('hey') },
'text/html; foo=bar; bar=baz': function(){ res.send('<p>hey</p>') },
'application/json; q=0.5': function(){ res.send({ message: 'hey' }) }
});
});

app.use(function(err, req, res, next){
app.use(function(err, req, res){
res.send(err.status, 'Supports: ' + err.types.join(', '));
});

Expand All @@ -127,7 +127,7 @@ describe('res', function(){
it('should be able to invoke other formatter', function (done) {
var app = express()

app.use(function (req, res, next) {
app.use(function (req, res) {
res.format({
json: function () { res.send('json') },
default: function () {
Expand Down Expand Up @@ -163,7 +163,7 @@ describe('res', function(){
});
});

router.use(function(err, req, res, next){
router.use(function(err, req, res){
res.send(err.status, 'Supports: ' + err.types.join(', '));
})

Expand Down

0 comments on commit 4752d5e

Please sign in to comment.