Create unit tests in OpenWhisk, all the guides you need are here!

Pure functions have many advantages,
no side effects,
the result of the function only depends on the input parameters, and
does not modify the state outside the scope,
any time the function is called with the same input parameters,
it will produce the same result.
This makes the code simple and clear enough.
When you call a pure function,
you just pay attention to its return value,
and don't worry about errors caused by problems elsewhere.


The modular nature of OpenWhisk applications makes
it easy to create unit tests for operations that are purely functional—meaning there are no side-effects and no dependencies on external state.

Today, let's learn how to create unit tests semi-automatically, and how to run those tests to verify that code changes didn't break anything. When using a function-as-a-service (FaaS) framework such as OpenWhisk, for any operation that is a pure function, you can apply automated QA using the methods learned today.

Things to do before you start:
The basics of OpenWhisk and JavaScript
A free IBM Cloud account

Immediately click " read the original text ", let us immediately start a wonderful learning journey~

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324939510&siteId=291194637