From ee72aa3fdbd9da6151490217c1970350e6cb3e92 Mon Sep 17 00:00:00 2001 From: fritx Date: Fri, 2 May 2014 23:55:31 +0800 Subject: [PATCH] Defaults files to ['test'] --- README.md | 2 ++ bin/nodeunit | 5 ++--- package.json | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e2f73cd32..43605b15d 100644 --- a/README.md +++ b/README.md @@ -212,6 +212,8 @@ using `sudo make install`. Example usage: nodeunit testmodule1.js testfolder [...] +If no entry file specified, `test` defaults. + The default test reporter uses color output, because I think that's more fun :) I intend to add a no-color option in future. To give you a feeling of the fun you'll be having writing tests, lets fix the example at the start of the README: diff --git a/bin/nodeunit b/bin/nodeunit index cb4cc7b19..e3e15b57c 100755 --- a/bin/nodeunit +++ b/bin/nodeunit @@ -101,10 +101,9 @@ args.forEach(function (arg) { } }); +// defaults to `test` if (files.length === 0) { - console.log('Files required.'); - console.log(usage); - process.exit(1); + files = ['test']; } if (config_file) { diff --git a/package.json b/package.json index 3f7459517..1b1d57e46 100644 --- a/package.json +++ b/package.json @@ -87,6 +87,6 @@ "tap": ">=0.2.3" }, "scripts": { - "test": "node ./bin/nodeunit test" + "test": "node ./bin/nodeunit" } }