This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.11.3.5. 测试 Node.js 功能
Node.js 功能可以在您的计算机上本地测试。在使用 kn func create
创建功能时创建的默认项目中,有一个 test 文件夹,其中包含一些简单的单元和集成测试。
先决条件
- 在集群中安装了 OpenShift Serverless Operator 和 Knative Serving。
-
已安装 Knative(
kn
)CLI。 -
已使用
kn func create
创建功能。
流程
- 导航到您的功能的 test 文件夹。
运行测试:
npm test
$ npm test
Copy to Clipboard Copied! Toggle word wrap Toggle overflow