Skip to content

Commit

Permalink
Add script for testing output
Browse files Browse the repository at this point in the history
  • Loading branch information
pahen committed Feb 5, 2017
1 parent f57480a commit e74df55
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
55 changes: 55 additions & 0 deletions test/output.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e74df55

Please sign in to comment.