Browse Source

test info in README, add verbose test option

jomo 10 years ago
parent
commit
1840ea6fd7
2 changed files with 20 additions and 2 deletions
  1. 17 1
      README.md
  2. 3 1
      test/test.js

+ 17 - 1
README.md

@@ -44,4 +44,20 @@ Please [visit the website](https://crafatar.com) for details.
 * `npm install`
 * Start `redis-server`
 * `npm start`
-* Access [http://localhost:3000](http://localhost:3000)
+* Access [http://localhost:3000](http://localhost:3000)
+
+
+## Tests
+```shell
+npm test
+```
+
+If you want to debug failing tests, you can set the env
+```shell
+VERBOSE_TEST=true
+```
+
+To debug caching, it can be helpful to monitor redis commands while tests are running:
+```shell
+redis-cli monitor
+```

+ 3 - 1
test/test.js

@@ -15,7 +15,9 @@ var request = require("request");
 config.http_timeout *= 3;
 
 // no spam
-//logging.log = function() {};
+if (!process.env.VERBOSE_TEST !== "true") {
+  logging.log = function() {};
+}
 
 var uuids = fs.readFileSync("test/uuids.txt").toString().split(/\r?\n/);
 var names = fs.readFileSync("test/usernames.txt").toString().split(/\r?\n/);