microsoftly/BotTester

Separating tests

Closed this issue · 1 comments

Hi, I am new to bottester. I wonder if there are ways to separate the code with the tests, maybe there are some ways to connect to the existing bot to test it or reuse part of the code?

As seen in the tests:

    it('can handle a single response', () => {
        bot.dialog('/', (session) => {
            session.send('hello!');
        });

        const botTester = new BotTester(bot)
            .sendMessageToBot('Hola!', 'hello!');

        return botTester.runTest();
    });

The part bot.dialog('/', (session) => { is already written in app.js, is there anyway for me not to write everything twice?

these were merely a way for me to show the docs clearly. This is a more advanced example of its use for reference.

If your Bot is stateless or you can clear the state between runs, you should be fine