Closed tmack8001 closed 5 years ago
Hi @tmack8001. Thanks for this pull request. 🙂
Can you please make sure that the tests pass?
I think the issue is that there is a test in the cli.spec.js
that tests wether an error message is printed. You might need to adjust this test so that it runs in a child process and maybe also check if it returns with error code 1.
ah yes, I was going to come back to the unit tests.
I'll also take your suggestion into consideration and fix that as well.
Instead of doing a child process as spawn
would be spawning a whole new node process I decided to just stub with sinon
like is already done with console.info
and console.error
.
Also left the existing test and added a new one about the return code.
new examples error log with a smaller example (bad file reference):
./bin/swagger-combine example.json
Error opening file "~/dev/oss/swagger-combine/1example.1.json"
ENOENT: no such file or directory, open '~/dev/oss/swagger-combine/1example.1.json'
✘
addresses the want to have an error code returned via cli if there is an error while processing the included configuration
example config:
The resulting terminal experience:
Addresses Issue: https://github.com/maxdome/swagger-combine/issues/67.