tschwecke / harvey

Easy and fast integration testing of RESTful web services
21 stars 9 forks source link

Makes harvey-transformer actually produce output #93

Closed nisaacson closed 7 years ago

nisaacson commented 7 years ago

In the current version of harvey, the harvey-transform command doesn't actually produce any output due to a missing call to processJson

Current

harvey-transform -j path/to/file.json -r console
# no output here

Fixed

Example schema.test.json output contained in file.json

harvey-transform -j path/to/file.json -r console
  ■ test/integration/schema.test.json
    ✓ schema

    Time elapsed: 414 ms
    1 tests complete, 0 failures.

  Overall time elapsed: 433 ms
  1 tests complete, 0 failures.

Invalid json in file

This change also prints appropriately formatted error output when input file contains invalid json

harvey-transform -j path/to/invalid.json -r console
Unable to load file "path/to/invalid.json": SyntaxError: Unexpected token o in JSON at position 1

Missing json file

This change also prints appropriately formatted error output when input file cannot be found

harvey-transform -j path/to/missing.json -r console
Unable to find file "path/to/missing.json"
nisaacson commented 7 years ago

@tschwecke 👍 for the fast merge. Can you please publish a new version to npm? thanks

tschwecke commented 7 years ago

@nisaacson sorry, forgot about that part. harvey@0.5.12 is published now. Thanks for the pull request, I appreciate it.