Test framework for Amazon Alexa Skills Kit SDK v2 for Node.js
ASK SDK for Node.jsの Version 2 のテストフレームワークです。
Install
npm install --save-dev alexa-conversation-model-assert
Samples
;; ; Conversation.initcondition // インテントリクエスト .requestIntent'LaunchRequest' // インテントリクエスト結果のプレーンテキスト完全一致 .equalPlain .requestIntent'AMAZON.HelpIntent' .equalPlain .requestIntent'AMAZON.StopIntent' .equalPlain // 停止インテントリクエストのSSMLテキスト完全一致 .equalSsml .end; Conversation.initcondition // インテントリクエスト .requestIntent'LaunchRequest' .requestIntent'HelloWorldIntent' // HelloWorldIntent speech, cardTitle, cardContentの検証 .equalPlain .end; Conversation.initcondition .requestIntent'LaunchRequest' // インテント呼出時のスロット値定義 .requestIntent'RecipeIntent', .end;
Conversation Assert
種類 | 概要 |
---|---|
equalPlain(expected: IOutputSpeech) | プレーンテキストが完全一致することを検証します。 |
equalSsml(expected: IOutputSpeech) | SSMLが完全一致することを検証します。 |
notEqualPlain(expected: IOutputSpeech) | プレーンテキストが完全一致しないことを検証します。 |
notEqualSsml(expected: IOutputSpeech) | SSMLが完全一致しないことを検証します。 |
containsPlain(expected: IOutputSpeech) | プレーンテキストが部分一致することを検証します。 |
containsSsml(expected: IOutputSpeech) | SSMLが部分一致することを検証します。 |
matchesPlain(expected: IOutputSpeech) | プレーンテキストが正規表現と一致することを検証します。 |
matchesSsml(expected: IOutputSpeech) | SSMLが正規表現と一致することを検証します。 |
doesNotMatchPlain(expected: IOutputSpeech) | プレーンテキストが正規表現と一致しないことを検証します。 |
doesNotMatchSsml(expected: IOutputSpeech) | SSMLが正規表現と一致しないことを検証します。 |
startsWithPlain(expected: IOutputSpeech) | プレーンテキストが前方一致することを検証します。 |
startsWithSsml(expected: IOutputSpeech) | SSMLが前方一致することを検証します。 |
endsWithPlain(expected: IOutputSpeech) | プレーンテキストが後方一致することを検証します。 |
endsWithSsml(expected: IOutputSpeech) | SSMLが後方一致することを検証します。 |