Permalink
Browse files

Add test running to npm

  • Loading branch information...
1 parent ad47289 commit fe46186a2d08c7b829b3d9eb1f601ed06b671edd Steven Berlan committed Sep 14, 2012
Showing with 10 additions and 6 deletions.
  1. +3 −0 package.json
  2. +6 −5 run_tests.js
  3. +1 −1 tests/tests.js
View
@@ -28,5 +28,8 @@
"uglify-js": ">=1.3.3",
"qunit": ">=0.5.7"
},
+ "scripts": {
+ "test": "node run_tests.js"
+ },
"optionalDependencies": {}
}
View
@@ -1,8 +1,6 @@
// Simple script runner used to test Node.JS.
-if (process.argv.length == 4) {
- process.env.CLOUDMINE_APPID = process.argv[2];
- process.env.CLOUDMINE_APIKEY = process.argv[3];
+if (process.env.CLOUDMINE_APPID && process.env.CLOUDMINE_APIKEY) {
var qunit = require('qunit');
var config = {
deps: [ "./tests/init.js", "./tests/util.js", "./tests/config.js" ],
@@ -13,6 +11,9 @@ if (process.argv.length == 4) {
qunit.run(config);
} else {
console.log("Cannot run tests without specifying an application id and api key.");
- console.log("Usage: node run_tests.js appid apikey");
- console.log("node run_tests.js 793dcffc4f67f94c36a8f20628d3d31b 8b05c2e5d0e88b471c5aae8ba6cf9f7b");
+ console.log("Please export the following variables in your shell:");
+ console.log(" CLOUDMINE_APPID: This should be the application id to test under");
+ console.log(" CLOUDMINE_APIKEY: This should be the api key to test under");
+ console.log("\nUnit tests may leave behind stale users and data.");
+ console.log("It is not recommended to run unit tests on a production application.");
}
View
@@ -22,7 +22,7 @@ $(function() {
});
asyncTest('Register a new user, verify user, cloudmine-agent, login the user, delete user.', 6, function() {
- console.log('Register a new user, verify user, cloudmine-agent, and log the user in');
+ console.log('Register a new user, verify user, cloudmine-agent, login the user, delete user.');
var user = {
email: util.noise(5) + '@' + util.noise(5) + '.com',
password: util.noise(5)

0 comments on commit fe46186

Please sign in to comment.