mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
26 lines
791 B
Plaintext
26 lines
791 B
Plaintext
// Module included in the following assemblies
|
|
//
|
|
// * /serverless/functions/serverless-developing-nodejs-functions.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="serverless-testing-nodejs-functions_{context}"]
|
|
= Testing Node.js functions
|
|
|
|
Node.js functions can be tested locally on your computer. In the default project that is created when you create a function by using `kn func create`, there is a *test* folder that contains some simple unit and integration tests.
|
|
|
|
.Prerequisites
|
|
|
|
* The {ServerlessOperatorName} and Knative Serving are installed on the cluster.
|
|
* You have installed the Knative (`kn`) CLI.
|
|
* You have created a function by using `kn func create`.
|
|
|
|
.Procedure
|
|
|
|
. Navigate to the *test* folder for your function.
|
|
. Run the tests:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ npm test
|
|
----
|