diff --git a/examples/auth/app.js b/examples/auth/app.js index 00175ad62d..5bca632682 100644 --- a/examples/auth/app.js +++ b/examples/auth/app.js @@ -118,6 +118,7 @@ app.post('/login', function(req, res){ }); }); +/* istanbul ignore next */ if (!module.parent) { app.listen(3000); console.log('Express started on port 3000'); diff --git a/examples/big-view/index.js b/examples/big-view/index.js index 2cb1a04258..35ad596387 100644 --- a/examples/big-view/index.js +++ b/examples/big-view/index.js @@ -20,5 +20,8 @@ app.get('/', function(req, res){ res.render('pets', { pets: pets }); }); -app.listen(3000); -console.log('Express listening on port 3000'); \ No newline at end of file +/* istanbul ignore next */ +if (!module.parent) { + app.listen(3000); + console.log('Express started on port 3000'); +} diff --git a/examples/content-negotiation/index.js b/examples/content-negotiation/index.js index db5ac86312..e8f7509f70 100644 --- a/examples/content-negotiation/index.js +++ b/examples/content-negotiation/index.js @@ -37,7 +37,8 @@ function format(path) { 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'); } diff --git a/examples/cookie-sessions/index.js b/examples/cookie-sessions/index.js index f7011003d2..929dd54751 100644 --- a/examples/cookie-sessions/index.js +++ b/examples/cookie-sessions/index.js @@ -26,7 +26,8 @@ function count(req, res) { res.send('viewed ' + n + ' times\n'); } +/* istanbul ignore next */ if (!module.parent) { app.listen(3000); - console.log('Express server listening on port 3000'); -} \ No newline at end of file + console.log('Express started on port 3000'); +} diff --git a/examples/cookies/app.js b/examples/cookies/app.js index f381fbed8c..d2ec02427b 100644 --- a/examples/cookies/app.js +++ b/examples/cookies/app.js @@ -48,7 +48,8 @@ app.post('/', function(req, res){ res.redirect('back'); }); -if (!module.parent){ +/* istanbul ignore next */ +if (!module.parent) { app.listen(3000); console.log('Express started on port 3000'); -} \ No newline at end of file +} diff --git a/examples/downloads/app.js b/examples/downloads/app.js index 69620fa948..965f3f6bdf 100644 --- a/examples/downloads/app.js +++ b/examples/downloads/app.js @@ -38,7 +38,8 @@ app.use(function(err, req, res, next){ } }); +/* istanbul ignore next */ if (!module.parent) { app.listen(3000); console.log('Express started on port 3000'); -} \ No newline at end of file +} diff --git a/examples/ejs/index.js b/examples/ejs/index.js index f9ee51c797..adf1254f14 100644 --- a/examples/ejs/index.js +++ b/examples/ejs/index.js @@ -44,7 +44,8 @@ app.get('/', function(req, res){ }); }); +/* istanbul ignore next */ if (!module.parent) { app.listen(3000); - console.log('Express app started on port 3000'); + console.log('Express started on port 3000'); } diff --git a/examples/error-pages/index.js b/examples/error-pages/index.js index 7c8fd31eb8..99a9e6f98a 100644 --- a/examples/error-pages/index.js +++ b/examples/error-pages/index.js @@ -106,7 +106,8 @@ app.get('/500', function(req, res, next){ next(new Error('keyboard cat!')); }); +/* istanbul ignore next */ if (!module.parent) { app.listen(3000); - silent || console.log('Express started on port 3000'); -} \ No newline at end of file + console.log('Express started on port 3000'); +} diff --git a/examples/error/index.js b/examples/error/index.js index be9cfb5177..1539514ee0 100644 --- a/examples/error/index.js +++ b/examples/error/index.js @@ -42,7 +42,8 @@ app.get('/next', function(req, res, next){ }); }); +/* istanbul ignore next */ if (!module.parent) { app.listen(3000); console.log('Express started on port 3000'); -} \ No newline at end of file +} diff --git a/examples/expose-data-to-client/index.js b/examples/expose-data-to-client/index.js index e0f72adbd6..0578941613 100644 --- a/examples/expose-data-to-client/index.js +++ b/examples/expose-data-to-client/index.js @@ -56,5 +56,8 @@ app.get('/user', function(req, res){ res.render('page'); }); -app.listen(3000); -console.log('app listening on port 3000'); \ No newline at end of file +/* istanbul ignore next */ +if (!module.parent) { + app.listen(3000); + console.log('Express started on port 3000'); +} diff --git a/examples/hello-world/index.js b/examples/hello-world/index.js index 2cd9fc456c..1932ae18c2 100644 --- a/examples/hello-world/index.js +++ b/examples/hello-world/index.js @@ -7,5 +7,8 @@ app.get('/', function(req, res){ res.send('Hello World'); }); -app.listen(3000); -console.log('Express started on port 3000'); +/* istanbul ignore next */ +if (!module.parent) { + app.listen(3000); + console.log('Express started on port 3000'); +} diff --git a/examples/jade/index.js b/examples/jade/index.js index 9c362015f0..6d955fdfd4 100644 --- a/examples/jade/index.js +++ b/examples/jade/index.js @@ -41,5 +41,8 @@ app.get('/', function(req, res){ res.render('users', { users: users }); }); -app.listen(3000); -console.log('Express app started on port 3000'); +/* istanbul ignore next */ +if (!module.parent) { + app.listen(3000); + console.log('Express started on port 3000'); +} diff --git a/examples/markdown/index.js b/examples/markdown/index.js index f872e13978..83733495da 100644 --- a/examples/markdown/index.js +++ b/examples/markdown/index.js @@ -39,6 +39,7 @@ app.get('/fail', function(req, res){ res.render('missing', { title: 'Markdown Example' }); }) +/* istanbul ignore next */ if (!module.parent) { app.listen(3000); console.log('Express started on port 3000'); diff --git a/examples/multipart/index.js b/examples/multipart/index.js index e2323595b9..dc810984b6 100644 --- a/examples/multipart/index.js +++ b/examples/multipart/index.js @@ -30,7 +30,8 @@ app.post('/', function(req, res, next){ , req.body.title)); }); +/* istanbul ignore next */ if (!module.parent) { app.listen(3000); console.log('Express started on port 3000'); -} \ No newline at end of file +} diff --git a/examples/mvc/index.js b/examples/mvc/index.js index 3811db4a5d..ee60525c17 100644 --- a/examples/mvc/index.js +++ b/examples/mvc/index.js @@ -86,7 +86,8 @@ app.use(function(req, res, next){ res.status(404).render('404', { url: req.originalUrl }); }); +/* istanbul ignore next */ if (!module.parent) { app.listen(3000); - console.log('\n listening on port 3000\n'); + console.log('Express started on port 3000'); } diff --git a/examples/online/index.js b/examples/online/index.js index 5ebfe6a760..44ef213e83 100644 --- a/examples/online/index.js +++ b/examples/online/index.js @@ -50,5 +50,8 @@ app.get('/', function(req, res, next){ }); }); -app.listen(3000); -console.log('listening on port 3000'); \ No newline at end of file +/* istanbul ignore next */ +if (!module.parent) { + app.listen(3000); + console.log('Express started on port 3000'); +} diff --git a/examples/params/app.js b/examples/params/app.js index 4c6e2b528a..3756541ad1 100644 --- a/examples/params/app.js +++ b/examples/params/app.js @@ -64,7 +64,8 @@ app.get('/users/:from-:to', function(req, res, next){ res.send('users ' + names.slice(from, to).join(', ')); }); +/* istanbul ignore next */ if (!module.parent) { app.listen(3000); console.log('Express started on port 3000'); -} \ No newline at end of file +} diff --git a/examples/resource/app.js b/examples/resource/app.js index 849a81c905..7aa5b13d74 100644 --- a/examples/resource/app.js +++ b/examples/resource/app.js @@ -85,7 +85,8 @@ app.get('/', function(req, res){ ].join('\n')); }); +/* istanbul ignore next */ if (!module.parent) { app.listen(3000); console.log('Express started on port 3000'); -} \ No newline at end of file +} diff --git a/examples/route-map/index.js b/examples/route-map/index.js index 1400ebe4bd..7122794fc8 100644 --- a/examples/route-map/index.js +++ b/examples/route-map/index.js @@ -60,4 +60,8 @@ app.map({ } }); -app.listen(3000); \ No newline at end of file +/* istanbul ignore next */ +if (!module.parent) { + app.listen(3000); + console.log('Express started on port 3000'); +} diff --git a/examples/route-middleware/index.js b/examples/route-middleware/index.js index c4d1d22f69..2d26a33a0f 100644 --- a/examples/route-middleware/index.js +++ b/examples/route-middleware/index.js @@ -81,5 +81,8 @@ app.delete('/user/:id', loadUser, andRestrictTo('admin'), function(req, res){ res.send('Deleted user ' + req.user.name); }); -app.listen(3000); -console.log('Express app started on port 3000'); \ No newline at end of file +/* istanbul ignore next */ +if (!module.parent) { + app.listen(3000); + console.log('Express started on port 3000'); +} diff --git a/examples/route-separation/index.js b/examples/route-separation/index.js index cb344e0a90..fcf9c505fe 100644 --- a/examples/route-separation/index.js +++ b/examples/route-separation/index.js @@ -36,5 +36,8 @@ app.put('/user/:id/edit', user.update); app.get('/posts', post.list); -app.listen(3000); -console.log('Express app started on port 3000'); +/* istanbul ignore next */ +if (!module.parent) { + app.listen(3000); + console.log('Express started on port 3000'); +} diff --git a/examples/search/index.js b/examples/search/index.js index 731c3c6183..374e5883c5 100644 --- a/examples/search/index.js +++ b/examples/search/index.js @@ -57,5 +57,8 @@ app.get('/client.js', function(req, res){ res.sendfile(__dirname + '/client.js'); }); -app.listen(3000); -console.log('app listening on port 3000'); +/* istanbul ignore next */ +if (!module.parent) { + app.listen(3000); + console.log('Express started on port 3000'); +} diff --git a/examples/session/index.js b/examples/session/index.js index 5ad94b7f15..f4e72054d6 100644 --- a/examples/session/index.js +++ b/examples/session/index.js @@ -28,5 +28,8 @@ app.get('/', function(req, res){ res.send(body + '

viewed ' + req.session.views + ' times.

'); }); -app.listen(3000); -console.log('Express app started on port 3000'); +/* istanbul ignore next */ +if (!module.parent) { + app.listen(3000); + console.log('Express started on port 3000'); +} diff --git a/examples/vhost/index.js b/examples/vhost/index.js index bbf5070ef1..732e86dd7a 100644 --- a/examples/vhost/index.js +++ b/examples/vhost/index.js @@ -42,5 +42,8 @@ var app = express(); app.use(express.vhost('*.example.com', redirect)) // Serves all subdomains via Redirect app app.use(express.vhost('example.com', main)); // Serves top level domain via Main server app -app.listen(3000); -console.log('Express app started on port 3000'); +/* istanbul ignore next */ +if (!module.parent) { + app.listen(3000); + console.log('Express started on port 3000'); +} diff --git a/examples/view-constructor/index.js b/examples/view-constructor/index.js index 3f1aa42240..000f419c04 100644 --- a/examples/view-constructor/index.js +++ b/examples/view-constructor/index.js @@ -41,6 +41,7 @@ app.get('/Readme.md', function(req, res){ res.render('Readme.md'); }) +/* istanbul ignore next */ if (!module.parent) { app.listen(3000); console.log('Express started on port 3000'); diff --git a/examples/view-locals/index.js b/examples/view-locals/index.js index 7658e83fa3..dc9421a25b 100644 --- a/examples/view-locals/index.js +++ b/examples/view-locals/index.js @@ -142,5 +142,8 @@ app.all('/api/*', function(req, res, next){ */ -app.listen(3000); -console.log('Application listening on port 3000'); \ No newline at end of file +/* istanbul ignore next */ +if (!module.parent) { + app.listen(3000); + console.log('Express started on port 3000'); +} diff --git a/examples/web-service/index.js b/examples/web-service/index.js index 045adaa863..f7c990ab54 100644 --- a/examples/web-service/index.js +++ b/examples/web-service/index.js @@ -109,7 +109,8 @@ app.get('/api/user/:name/repos', function(req, res, next){ else next(); }); +/* istanbul ignore next */ if (!module.parent) { app.listen(3000); - console.log('Express server listening on port 3000'); -} \ No newline at end of file + console.log('Express started on port 3000'); +}