In this section, you will create a test script to test FortuneCookie using the Dialogflow client SDK in Node.js:
- Open Command Prompt and type npm install dialogflow --save.
- Create a file called testscript.js.
- In testscript.js, you will begin by declaring the projectId you got in the Setting up the Dialogflow client SDK section. Then, declare sessionId, which identifies the session as your test session, and the languageCode as English.
- Then, declare the Dialogflow dialogflow = require('dialogflow') component and create the Dialogflow sessionClient.sessionPath(projectId, sessionId) session, which you will use to trigger intents in FortuneCookie.
The following code shows the declared variables ...