Hacker News new | ask | show | jobs
by rgoulter 2418 days ago
Testing an HTTP API involves running the server, and running a client against that.

Postman, insomnia, and Milkman are REST clients.

I haven't tried it, but I think it'd be quite awkward to get a server setup from Postman. I think it would at least involve calls to external programs to start a server, or to run against an already running server.

The more apples-to-apples comparison would be using Postman vs the chai tests. I'd argue that writing tests in JavaScript with something like Chai as described in the post is better than postman, because the code is in 'readable plaintext' rather than JSON.

2 comments

>Testing an HTTP API involves running the server, and running a client against that.

That's exactly what tools like Postman are used for. How are you doing any testing during the development process if you're not hosting your web API even locally?

>I haven't tried it, but I think it'd be quite awkward to get a server setup from Postman

There's no need to as I mentioned that you're going to be hosting it somewhere during development anyway.

> There's no need to as I mentioned that you're going to be hosting it somewhere during development anyway.

You will probably host 1 version which is infrastructure heavy and not very flexible. Take 10 developers working on the API. They all need to test their changes. Automatically if possible. Hosting external elements like the database and others is a pain eased by Docker.

Hmm, seems like the workflow you've described is a bottleneck leading to this. Wouldn't you have some kind of test/staging environment that is accessible for this purpose?
For this reason I created https://www.apilope.com - you can trigger hosted API tests from your CI workflow as well.
Getting a warning on the latest Firefox; seems like the certificate is expired.