Calling SLS from unit test framework?

Hi.
I am experimenting with serverless, and getting the hang of things.
But I belong to the school that thinks that development isn’t worth doing unless you have automated integration tests as well.

But I have completely failed to find a way to call sls invoke -f -d from anything other than an interactive shell. As soon as I start wrapping it in something (Have tried Bats test for bash scripts and from ava using shelljs) then it seems my escaped JSON gets mangled or something else goes wrong.

Is someone else doing something like this, and is there a smart way of doing it. My way does not seem to be the smart way.