fac30sb / discord-chatbot-emma-egbie

0 stars 0 forks source link

Simulate receiving a message and verify bot response #51

Closed blackNoir2 closed 7 months ago

blackNoir2 commented 7 months ago

Test: simulate receiving a message and verify that my bot responds with a “hello” message, testing the message event listener’s functionality

  1. Implemented a new test to verify the bot's response with a "hello" message upon receiving a simulated message. This test validates the functionality of the message event listener, ensuring that the bot reacts appropriately to incoming messages.

  2. Added negative test cases to the test suite to cover scenarios where the bot fails to display the expected message upon login. These tests help identify potential weaknesses and improve the robustness of the bot.

  3. Updated the Nodemon version from version 2 to 3.1.0 in the package.json file to the latest release. The previous nodemon version was causing compatibility issues, leading to incorrect behaviour in the bot. For example when running on Discord this will cause the data, any direct messaging sent, displayed chat history and any displayed messages to be done twice. The upgrade resolves these issues and ensures proper functionality.

Here is a video of all the tests passing.

https://www.youtube.com/watch?v=8pzw2MO3COw

Here in this demo video I have intentionally caused three tests to fail to see if they are recorded as failure

https://www.youtube.com/watch?v=B9BgRtVihcg