Skip to content

Commit

Permalink
Coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
daquinoaldo committed Sep 11, 2018
1 parent 560f3b6 commit ee95687
Show file tree
Hide file tree
Showing 7 changed files with 710 additions and 17 deletions.
2 changes: 0 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"extends": "standard",
//"extends": "strongloop",
//"extends": "eslint:recommended",
"env": {
"node": true,
"es6": true,
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
.DS_STORE
node_modules
node_modules
coverage
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
language: node_js
node_js:
- "node"
- "node"
after_script: "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ You can activate the http redirect again specifying not only the PORT environmen

#### Close the server
You can close the server with `app.close()`.
Closing the server is an async operation, you can get notified with `app.close(callback)` or `app.close().then(...)`.
Closing the server is an async operation, you can get notified with a promise: `app.close().then(...)`.

---

Expand Down
7 changes: 3 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ if (require.main === module) {
}

// ready
if (!process.env.TEST) console.info("Server running on port " + port + ".")
console.info("Server running on port " + port + ".")

// close the app
app.close = (callback) => {
app.close = () => {
const promises = [
new Promise(resolve => app.http.close(resolve)),
new Promise(resolve => app.server.close(resolve))
Expand All @@ -67,8 +67,7 @@ app.close = (callback) => {
for (const socketId in sockets)
sockets[socketId].destroy()
return Promise.all(promises).then(() => {
if (!process.env.TEST) console.info("Server closed.")
if (callback) callback()
console.info("Server closed.")
})
}

Expand Down

0 comments on commit ee95687

Please sign in to comment.