Permalink
Browse files

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...
1 parent 1cc3b0c commit 233ed85116e2b38936233560e9cbb29517ca6e21 @theycallmeswift theycallmeswift committed Jun 21, 2012
Showing with 28 additions and 5 deletions.
  1. +1 −0 .gitignore
  2. +1 −1 Makefile
  3. +20 −0 README.md
  4. +5 −3 index.js
  5. 0 test/{test.setup → config.sample.js}
  6. +1 −1 test/test_helper.js
View
@@ -1,3 +1,4 @@
node_modules/
npm-debug.log
.DS_Store
+test/config.js
View
@@ -1,4 +1,4 @@
test:
- find test -name "*.test.js" | xargs mocha
+ ./node_modules/.bin/mocha test --recursive
.PHONY: test
View
@@ -11,6 +11,26 @@ Licensed under the MIT License.
npm install sendgrid
```
+## Testing ##
+
+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:
+
+```
+cp test/config.sample.js test/config.js
+```
+
+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:
+
+```
+make test
+```
+
+You can run individual tests with the following command:
+
+```
+./node_modules/.bin/mocha [path to test].js
+```
+
## Usage ##
### It can be this easy ###
View
@@ -1,3 +1,5 @@
-module.exports.SendGrid = require('./lib/sendgrid');
-module.exports.Email = require('./lib/email');
-module.exports.SmtpapiHeaders = require('./lib/smtpapi_headers');
+module.exports = {
+ SendGrid: require('./lib/sendgrid'),
+ Email: require('./lib/email'),
+ SmtpapiHeaders: require('./lib/smtpapi_headers')
+};
File renamed without changes.
View
@@ -1,2 +1,2 @@
global.expect = require('chai').expect;
-global.setup = require('./test.setup');
+global.setup = require('./config');

0 comments on commit 233ed85

Please sign in to comment.