Skip to content

Test coverage #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 41 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Following variables can be configured:
- after you did database restore above,
- execute `test_files/sql/email.sql` on heroku postgres.

$ cat test_files/sql/email.sql | heroku pg:psql
$ cat test_files/sql/email.sql | heroku pg:psql
---> Connecting to DATABASE_URL
SET
SET
Expand All @@ -105,6 +105,44 @@ Following variables can be configured:
GRANT


## Test and Coverage
- Follow *Database restore* to input test data
- Make sure `test_files/sql/email.sql` has been executed
- Make sure `test_files/sql/demo.sql` has been executed
- Adjust some test data in `test/test-helper.js`
- EX `emailIdDelivered`, this is email id which has delivered successful.
If We use email id just sent, we may get `404 Not Found` error
or not delivered response, both make test fail.
So we need input a successful delivered email id manually.
- Run test `npm run test`
- Report Coverage
- `npm install -g istanbul`
- `npm run coverage`

```
2016-09-13T20:33:46.340Z - debug: undefined
POST /api/v1/reset 200 162.002 ms - -
✓ reset (163ms)


84 passing (9s)

=============================================================================
Writing coverage object [/home/stevenfrog/temp/TC-StartPack-Nodejs-test-coverage/Topcoder-StarterPac
k_Node-Backend/coverage/coverage.json]
Writing coverage reports at [/home/stevenfrog/temp/TC-StartPack-Nodejs-test-coverage/Topcoder-Starte
rPack_Node-Backend/coverage]
=============================================================================

=============================== Coverage summary ===============================
Statements : 92.44% ( 1369/1481 )
Branches : 64.62% ( 221/342 )
Functions : 100% ( 134/134 )
Lines : 92.35% ( 1352/1464 )
================================================================================
```


## Setup postman
- Load postman collection:

Expand Down Expand Up @@ -175,7 +213,7 @@ Following variables can be configured:

## Additional functionality

- `GET /emails/stats` endpoint for tracking Mailgun usage for past 1 month.
- `GET /emails/stats` endpoint for tracking Mailgun usage for past 1 month.

## Module system for future developers

Expand All @@ -185,7 +223,7 @@ Following variables can be configured:
- a module should have `routes.js` on top, `src/modules/<module name>/routes.js`. declare routes to controllers in this file.
- use relative imports, e.g ) `const service = require('../services/fooService');` to load services from controllers within a module, or import between services within a module.
- currently existing modules: `crud`, `sample`, `mail`
- how the modules are loaded: `src/app-routes.js` will glob `src/modules/*/routes.js` and load them.
- how the modules are loaded: `src/app-routes.js` will glob `src/modules/*/routes.js` and load them.
- remove a module from application by deleting a module directory.

## Authentication & Authorization
Expand Down
1 change: 1 addition & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ const port = config.port;
app.listen(port, '0.0.0.0');
logger.info('Express server listening on port %d in %s mode', port, process.env.NODE_ENV);

module.exports = app;
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy