Testing the Bot
It's simple
We made testing bots as simple as possible. Our testing tool provides methods for simulating
const { Tester } = require('wingbot');const assert = require('assert');const bot = require('../botRoot');describe('/bot', function () {it('should work', async function () {const t = new Tester(bot);await t.postBack('/start'); // send the postbackt.passedAction('start'); // check, that action passedt.any().contains('Hello') // check the text response.quickReplyAction('continue');await t.quickReply('continue'); // select the quick replyt.passedAction('introduction');await t.text('Show me the goods!');t.any().templateType('generic'); // look for generic template// check the stateassert.strictEqual(t.getState().seenGoods, true, 'seenGoods has to be true');});});