Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Cleaned up and documented the tests.

This commit includes the following changes:

 - Renamed `test/test.setup` -> `test/config.js` to match standard
 - Changed Makefile to use the local copy of mocha (recursive)
 - Wrote docs for running the tests
  • Loading branch information...
commit 233ed85116e2b38936233560e9cbb29517ca6e21 1 parent 1cc3b0c
Swift theycallmeswift authored
1  .gitignore
... ... @@ -1,3 +1,4 @@
1 1 node_modules/
2 2 npm-debug.log
3 3 .DS_Store
  4 +test/config.js
2  Makefile
... ... @@ -1,4 +1,4 @@
1 1 test:
2   - find test -name "*.test.js" | xargs mocha
  2 + ./node_modules/.bin/mocha test --recursive
3 3
4 4 .PHONY: test
20 README.md
Source Rendered
@@ -11,6 +11,26 @@ Licensed under the MIT License.
11 11 npm install sendgrid
12 12 ```
13 13
  14 +## Testing ##
  15 +
  16 +In order to run the integration tests, you'll need to update the config file with your valid SendGrid credentials. Start by making a live copy of the sample:
  17 +
  18 +```
  19 +cp test/config.sample.js test/config.js
  20 +```
  21 +
  22 +Next, open up `test/config.js` and fill it in. After you have updated the configuration file with your credentials, you can run the suite using the following command:
  23 +
  24 +```
  25 +make test
  26 +```
  27 +
  28 +You can run individual tests with the following command:
  29 +
  30 +```
  31 +./node_modules/.bin/mocha [path to test].js
  32 +```
  33 +
14 34 ## Usage ##
15 35 ### It can be this easy ###
16 36
8 index.js
... ... @@ -1,3 +1,5 @@
1   -module.exports.SendGrid = require('./lib/sendgrid');
2   -module.exports.Email = require('./lib/email');
3   -module.exports.SmtpapiHeaders = require('./lib/smtpapi_headers');
  1 +module.exports = {
  2 + SendGrid: require('./lib/sendgrid'),
  3 + Email: require('./lib/email'),
  4 + SmtpapiHeaders: require('./lib/smtpapi_headers')
  5 +};
0  test/test.setup → test/config.sample.js
File renamed without changes
2  test/test_helper.js
... ... @@ -1,2 +1,2 @@
1 1 global.expect = require('chai').expect;
2   -global.setup = require('./test.setup');
  2 +global.setup = require('./config');

0 comments on commit 233ed85

Please sign in to comment.
Something went wrong with that request. Please try again.