diff --git a/package.json b/package.json index 36315867..d73affc4 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,8 @@ "debug": "node bin/cli.js --debug bin lib", "generate": "npm run generate:small && npm run generate:madge", "generate:small": "bin/cli.js --image /tmp/simple.svg test/cjs/circular/a.js", - "generate:madge": "bin/cli.js --image /tmp/madge.svg bin lib" + "generate:madge": "bin/cli.js --image /tmp/madge.svg bin lib", + "test:output": "./test/output.sh" }, "dependencies": { "chalk": "^1.1.3", diff --git a/test/output.sh b/test/output.sh new file mode 100755 index 00000000..61425835 --- /dev/null +++ b/test/output.sh @@ -0,0 +1,55 @@ +#!/bin/sh + +function desc() { + echo "\033[01;38;5;022m############### $1 ###############\033[0m"; +} + +desc "LIST" +./bin/cli.js lib/api.js + +desc "SUMMARY" +./bin/cli.js lib/api.js -s + +desc "DEPENDS" +./bin/cli.js lib/api.js -d log + +desc "CIRCULAR (OK)" +./bin/cli.js test/cjs/a.js -c + +desc "CIRCULAR (FOUND)" +./bin/cli.js test/cjs/circular/a.js -c + +desc "NPM" +./bin/cli.js test/cjs/npm.js --include-npm + +desc "STDIN" +./bin/cli.js --json lib/api.js | tr '[a-z]' '[A-Z]' | ./bin/cli.js --stdin + +desc "IMAGE" +./bin/cli.js lib/api.js --image /tmp/test.svg + +desc "DOT" +./bin/cli.js lib/api.js --dot + +desc "JSON" +./bin/cli.js lib/api.js --json + +desc "NO COLOR" +./bin/cli.js lib/api.js --no-color + +desc "SHOW EXTENSION" +./bin/cli.js lib/api.js --show-extension + +desc "WARNINGS (NOTE)" +./bin/cli.js test/cjs/missing.js -c + +desc "WARNINGS (LIST)" +./bin/cli.js test/cjs/missing.js -c --warning + +desc "ERROR" +./bin/cli.js file/not/found.js + +desc "DEBUG" +./bin/cli.js lib/log.js --debug + +exit 0 \ No newline at end of file