
Show HN: Declarative Testing Framework for REST, GraphQL APIs - kiranz
https://github.com/kiranz/just-api
======
thosakwe
I wouldn’t really say this is any more “codeless” than HTML, SQL, or Prolog,
because you’re stilling writing unit tests, but in YAML instead of an
imperative language like JavaScript.

I think the word you’re _really_ looking for is “declarative.”

~~~
dang
OK, we've s/codeless/declarative/'d the above.

------
johns
We attempted to come up with a similar format for Runscope tests (YAML and
all) but quickly abandoned it once we tried anything remotely complex (chained
requests, control flow, limits of declarative assertions, etc.). YAML quickly
becomes far less expressive than code. I still prefer using a UI like Runscope
personally, but I’d use code if it weren’t available.

Also, any proper GraphQL support would abstract away the payload format. It
should simulate a GraphQL client, not an HTTP client.

~~~
kiranz
Not sure if you had a chance to go through documentation, but complex stuff
like chained requests, dynamic parameter construction etc are supported. You
can also provide custom validator functions in YAML to verify responses and a
lot more.

Please checkout the documentation.

~~~
pintxo
So it is not actually codeless.

------
caleblloyd
Neat library, I can see how this could be beneficial for black-box and end-to-
end API tests. Node seems powerful here due to the event loop being able to
run many parallel HTTP requests with one thread.

Were there any libraries you considered first before creating this? Or parts
of an existing library you took influence from?

~~~
kiranz
I didn't find any open source frameworks that support testing advanced API
flows like multipart forms and uploading files etc. Many companies are
actually charging customers for API testing, so I wanted to build a robust
open source alternative.

------
dbwest
This looks like pyresttest.

------
tmpz22
This is cool but I'd rather not add node and npm as dependencies to my
application unless its already there. I think this would be better as a static
binary or rolled into a CI platform.

~~~
kiranz
May be dockerize it?

