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
Provenance
- Commit
c18c2a8- Tree
be3d1f5- Author
Douglas Christopher Wilson <doug@somethingdoug.com>- Committer
Douglas Christopher Wilson <doug@somethingdoug.com>- Parent
1d54868
27 files changed+91 added−39 removed
modified:examples/auth/app.js+1 added
116 unmodified linesExpand all117118119120121122123124125116 unmodified linesExpand all } });});
/* istanbul ignore next */if (!module.parent) { app.listen(3000); console.log('Express started on port 3000');}modified:examples/big-view/index.js+5 added-2 removed
18 unmodified lines192021222324232425262718 unmodified linesapp.get('/', function(req, res){ res.render('pets', { pets: pets });});
/* istanbul ignore next */if (!module.parent) {app.listen(3000);console.log('Express listening on port 3000'); app.listen(3000); console.log('Express started on port 3000');}modified:examples/content-negotiation/index.js+2 added-1 removed
35 unmodified lines3637383940414242434435 unmodified lines}
app.get('/users', format('./users'));
/* istanbul ignore next */if (!module.parent) { app.listen(3000); console.log('listening on port 3000'); console.log('Express started on port 3000');}modified:examples/cookie-sessions/index.js+3 added-2 removed
24 unmodified lines25 var n = req.session.count++;26 res.send('viewed ' + n + ' times\n');27 }28 29+/* istanbul ignore next */30 if (!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 lines47 if (req.body.remember) res.cookie('remember', 1, { maxAge: minute });48 res.redirect('back');49 });50 51+/* istanbul ignore next */51-if (!module.parent){52+if (!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 lines37 next(err);38 }39 });40 41+/* istanbul ignore next */42 if (!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 lines43 header: "Some users"44 });45 });46 47+/* istanbul ignore next */48 if (!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 lines41 next(new Error('oh no!'));42 });43 });44 45+/* istanbul ignore next */46 if (!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 lines105 // trigger a generic (500) error106 next(new Error('keyboard cat!'));107 });108 109+/* istanbul ignore next */110 if (!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 lines55 res.locals.expose.user = req.user;56 res.render('page');57 });58 59+/* istanbul ignore next */60+if (!module.parent) {59-app.listen(3000);60-console.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 lines6 app.get('/', function(req, res){7 res.send('Hello World');8 });9 10+/* istanbul ignore next */11+if (!module.parent) {10-app.listen(3000);11-console.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 lines40 app.get('/', function(req, res){41 res.render('users', { users: users });42 });43 44+/* istanbul ignore next */45+if (!module.parent) {44-app.listen(3000);45-console.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 lines38 app.get('/fail', function(req, res){39 res.render('missing', { title: 'Markdown Example' });40 })41 42+/* istanbul ignore next */43 if (!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 lines29 , req.files.image.path30 , req.body.title));31 });32 33+/* istanbul ignore next */34 if (!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 lines85 app.use(function(req, res, next){86 res.status(404).render('404', { url: req.originalUrl });87 });88 89+/* istanbul ignore next */90 if (!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 lines49 res.send('<p>Users online: ' + ids.length + '</p>' + list(ids));50 });51 });52 53+/* istanbul ignore next */54+if (!module.parent) {53-app.listen(3000);54-console.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 lines63 , names = users.map(function(user){ return user.name; });64 res.send('users ' + names.slice(from, to).join(', '));65 });66 67+/* istanbul ignore next */68 if (!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 lines84 , '</ul>'85 ].join('\n')); 86 });87 88+/* istanbul ignore next */89 if (!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 lines59 }60 }61 });62 63+/* istanbul ignore next */64+if (!module.parent) {63-app.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 lines80 app.delete('/user/:id', loadUser, andRestrictTo('admin'), function(req, res){81 res.send('Deleted user ' + req.user.name);82 });83 84+/* istanbul ignore next */85+if (!module.parent) {84-app.listen(3000);85-console.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 lines35 // Posts36 37 app.get('/posts', post.list);38 39+/* istanbul ignore next */40+if (!module.parent) {39-app.listen(3000);40-console.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 lines56 app.get('/client.js', function(req, res){57 res.sendfile(__dirname + '/client.js');58 });59 60+/* istanbul ignore next */61+if (!module.parent) {60-app.listen(3000);61-console.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 lines27 }28 res.send(body + '<p>viewed <strong>' + req.session.views + '</strong> times.</p>');29 });30 31+/* istanbul ignore next */32+if (!module.parent) {31-app.listen(3000);32-console.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 lines41 42 app.use(express.vhost('*.example.com', redirect)) // Serves all subdomains via Redirect app43 app.use(express.vhost('example.com', main)); // Serves top level domain via Main server app 44 45+/* istanbul ignore next */46+if (!module.parent) {45-app.listen(3000);46-console.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 lines40 // rendering a view from https://github.com/visionmedia/express/blob/master/Readme.md41 res.render('Readme.md');42 })43 44+/* istanbul ignore next */45 if (!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 lines141 });142 143 */144 145+/* istanbul ignore next */146+if (!module.parent) {145-app.listen(3000);146-console.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 lines108 if (user) res.send(user);109 else next();110 });111 112+/* istanbul ignore next */113 if (!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+}