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.5.5. TypeScript 関数のテスト
Typescript 機能は、お使いのコンピューターでローカルでテストできます。kn func create を使用した関数の作成時に作成される default プロジェクトには、test フォルダーがあり、一部の単純なユニットおよび統合テストが含まれます。
前提条件
- OpenShift Serverless Operator および Knative Serving がクラスターにインストールされている。
-
Knative (
kn) CLI をインストールしている。 -
kn func createを使用して関数を作成している。
手順
テストを実行していない場合は、最初に依存関係をインストールします。
npm install
$ npm installCopy to Clipboard Copied! Toggle word wrap Toggle overflow - 関数の test フォルダーに移動します。
テストを実行します。
npm test
$ npm testCopy to Clipboard Copied! Toggle word wrap Toggle overflow