Skip to content

Adds test for /server resource#19

Open
derekr wants to merge 1 commit intotrulia:masterfrom
derekr:master
Open

Adds test for /server resource#19
derekr wants to merge 1 commit intotrulia:masterfrom
derekr:master

Conversation

@derekr
Copy link
Contributor

@derekr derekr commented Dec 17, 2014

Initial stab at adding basic integration tests. Currently this only tests the /api/server* route by checking for a 200 ok response from thoth-api and that the response object from thoth-index is flattened.

{ response: { numFound: 0, start: 0, docs: [] }

would be

{ numFound: 0, start: 0, docs: [] }

Let me know if my assumption of the thoth-index response handling is correct.

The tests are generic enough that you could run against an actual running thoth-index and not change the port to 3002 as the readme suggest.

Convention

Integration tests would go under /tests/integration and naming the resource w/ the request type being tested.
So testing a GET request 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 request instead of http in the dispatcher modules.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@ingiulio
Copy link
Contributor

ingiulio commented Feb 9, 2015

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants