Skip to content
Myr

tests: exclude untestable lines in examples from coverage

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parent 1d54868 · Browse files · 27 files+91 added−39 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

27 files+91 added−39 removed

  • other:+91 added−39 removed

27 files+91 added−39 removed

modified:examples/auth/app.js+1 added
modified:examples/big-view/index.js+5 added-2 removed
modified:examples/content-negotiation/index.js+2 added-1 removed
modified:examples/cookie-sessions/index.js+3 added-2 removed
24 unmodified lines
25 var n = req.session.count++;26 res.send('viewed ' + n + ' times\n');27}2829/* istanbul ignore next */30if (!module.parent) {31 app.listen(3000);31 console.log('Express server listening on port 3000');32}32 console.log('Express started on port 3000');33}
modified:examples/cookies/app.js+3 added-2 removed
46 unmodified lines
47 if (req.body.remember) res.cookie('remember', 1, { maxAge: minute });48 res.redirect('back');49});5051/* istanbul ignore next */51if (!module.parent){52if (!module.parent) {53 app.listen(3000);54 console.log('Express started on port 3000');54}55}
modified:examples/downloads/app.js+2 added-1 removed
36 unmodified lines
37 next(err);38 }39});4041/* istanbul ignore next */42if (!module.parent) {43 app.listen(3000);44 console.log('Express started on port 3000');44}45}
modified:examples/ejs/index.js+2 added-1 removed
42 unmodified lines
43 header: "Some users"44 });45});4647/* istanbul ignore next */48if (!module.parent) {49 app.listen(3000);49 console.log('Express app started on port 3000');50 console.log('Express started on port 3000');51}
modified:examples/error/index.js+2 added-1 removed
40 unmodified lines
41 next(new Error('oh no!'));42 });43});4445/* istanbul ignore next */46if (!module.parent) {47 app.listen(3000);48 console.log('Express started on port 3000');48}49}
modified:examples/error-pages/index.js+3 added-2 removed
104 unmodified lines
105 // trigger a generic (500) error106 next(new Error('keyboard cat!'));107});108109/* istanbul ignore next */110if (!module.parent) {111 app.listen(3000);111 silent || console.log('Express started on port 3000');112}112 console.log('Express started on port 3000');113}
modified:examples/expose-data-to-client/index.js+5 added-2 removed
54 unmodified lines
55 res.locals.expose.user = req.user;56 res.render('page');57});5859/* istanbul ignore next */60if (!module.parent) {59app.listen(3000);60console.log('app listening on port 3000');61 app.listen(3000);62 console.log('Express started on port 3000');63}
modified:examples/hello-world/index.js+5 added-2 removed
5 unmodified lines
6app.get('/', function(req, res){7 res.send('Hello World');8});910/* istanbul ignore next */11if (!module.parent) {10app.listen(3000);11console.log('Express started on port 3000');12 app.listen(3000);13 console.log('Express started on port 3000');14}
modified:examples/jade/index.js+5 added-2 removed
39 unmodified lines
40app.get('/', function(req, res){41 res.render('users', { users: users });42});4344/* istanbul ignore next */45if (!module.parent) {44app.listen(3000);45console.log('Express app started on port 3000');46 app.listen(3000);47 console.log('Express started on port 3000');48}
modified:examples/markdown/index.js+1 added
37 unmodified lines
38app.get('/fail', function(req, res){39 res.render('missing', { title: 'Markdown Example' });40})4142/* istanbul ignore next */43if (!module.parent) {44 app.listen(3000);45 console.log('Express started on port 3000');46}
modified:examples/multipart/index.js+2 added-1 removed
28 unmodified lines
29 , req.files.image.path30 , req.body.title));31});3233/* istanbul ignore next */34if (!module.parent) {35 app.listen(3000);36 console.log('Express started on port 3000');36}37}
modified:examples/mvc/index.js+2 added-1 removed
84 unmodified lines
85app.use(function(req, res, next){86 res.status(404).render('404', { url: req.originalUrl });87});8889/* istanbul ignore next */90if (!module.parent) {91 app.listen(3000);91 console.log('\n listening on port 3000\n');92 console.log('Express started on port 3000');93}
modified:examples/online/index.js+5 added-2 removed
48 unmodified lines
49 res.send('<p>Users online: ' + ids.length + '</p>' + list(ids));50 });51});5253/* istanbul ignore next */54if (!module.parent) {53app.listen(3000);54console.log('listening on port 3000');55 app.listen(3000);56 console.log('Express started on port 3000');57}
modified:examples/params/app.js+2 added-1 removed
62 unmodified lines
63 , names = users.map(function(user){ return user.name; });64 res.send('users ' + names.slice(from, to).join(', '));65});6667/* istanbul ignore next */68if (!module.parent) {69 app.listen(3000);70 console.log('Express started on port 3000');70}71}
modified:examples/resource/app.js+2 added-1 removed
83 unmodified lines
84 , '</ul>'85 ].join('\n')); 86});8788/* istanbul ignore next */89if (!module.parent) {90 app.listen(3000);91 console.log('Express started on port 3000');91}92}
modified:examples/route-map/index.js+5 added-1 removed
58 unmodified lines
59 }60 }61});6263/* istanbul ignore next */64if (!module.parent) {63app.listen(3000);65 app.listen(3000);66 console.log('Express started on port 3000');67}
modified:examples/route-middleware/index.js+5 added-2 removed
79 unmodified lines
80app.delete('/user/:id', loadUser, andRestrictTo('admin'), function(req, res){81 res.send('Deleted user ' + req.user.name);82});8384/* istanbul ignore next */85if (!module.parent) {84app.listen(3000);85console.log('Express app started on port 3000');86 app.listen(3000);87 console.log('Express started on port 3000');88}
modified:examples/route-separation/index.js+5 added-2 removed
34 unmodified lines
35// Posts3637app.get('/posts', post.list);3839/* istanbul ignore next */40if (!module.parent) {39app.listen(3000);40console.log('Express app started on port 3000');41 app.listen(3000);42 console.log('Express started on port 3000');43}
modified:examples/search/index.js+5 added-2 removed
55 unmodified lines
56app.get('/client.js', function(req, res){57 res.sendfile(__dirname + '/client.js');58});5960/* istanbul ignore next */61if (!module.parent) {60app.listen(3000);61console.log('app listening on port 3000');62 app.listen(3000);63 console.log('Express started on port 3000');64}
modified:examples/session/index.js+5 added-2 removed
26 unmodified lines
27 }28 res.send(body + '<p>viewed <strong>' + req.session.views + '</strong> times.</p>');29});3031/* istanbul ignore next */32if (!module.parent) {31app.listen(3000);32console.log('Express app started on port 3000');33 app.listen(3000);34 console.log('Express started on port 3000');35}
modified:examples/vhost/index.js+5 added-2 removed
40 unmodified lines
4142app.use(express.vhost('*.example.com', redirect)) // Serves all subdomains via Redirect app43app.use(express.vhost('example.com', main)); // Serves top level domain via Main server app 4445/* istanbul ignore next */46if (!module.parent) {45app.listen(3000);46console.log('Express app started on port 3000');47 app.listen(3000);48 console.log('Express started on port 3000');49}
modified:examples/view-constructor/index.js+1 added
39 unmodified lines
40 // rendering a view from https://github.com/visionmedia/express/blob/master/Readme.md41 res.render('Readme.md');42})4344/* istanbul ignore next */45if (!module.parent) {46 app.listen(3000);47 console.log('Express started on port 3000');48}
modified:examples/view-locals/index.js+5 added-2 removed
140 unmodified lines
141});142143*/144145/* istanbul ignore next */146if (!module.parent) {145app.listen(3000);146console.log('Application listening on port 3000');147 app.listen(3000);148 console.log('Express started on port 3000');149}
modified:examples/web-service/index.js+3 added-2 removed
107 unmodified lines
108 if (user) res.send(user);109 else next();110});111112/* istanbul ignore next */113if (!module.parent) {114 app.listen(3000);114 console.log('Express server listening on port 3000');115}115 console.log('Express started on port 3000');116}