Open
Conversation
Contributor
There was a problem hiding this comment.
hey @derekr what would t be? can you use a more explicit name? (or is this a convention?)
ah, nevermind. I just read about the tap module
Contributor
|
+1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Initial stab at adding basic integration tests. Currently this only tests the
/api/server*route by checking for a200ok response fromthoth-apiand that the response object fromthoth-indexis flattened.would be
Let me know if my assumption of the
thoth-indexresponse handling is correct.The tests are generic enough that you could run against an actual running
thoth-indexand not change the port to3002as the readme suggest.Convention
Integration tests would go under
/tests/integrationand naming the resource w/ the request type being tested.So testing a
GETrequest against the/api/server*resource would be/server-get.js.Modules
Using tap for testing because it's super simple. Added request to simplify the request handling in tests, though it might be worth looking in to using
requestinstead ofhttpin thedispatchermodules.