Client-side tests with C#Bot
The client-side testing framework for a C#Bot application utilises Jest and Enzyme to write unit tests which ensure individual components are working as intended. Jest is a testing framework which is used to write and run the tests and make assertions, whereas Enzyme is a tool which allows for simulating and interacting with React components.
The bot-written client-side tests for a C#Bot application can be found in ‘clientside/src/__tests__/botwritten’.
You can use yarn to run the client-side tests using the following command:
This will activate watch mode which waits for any modification to a client-side file, and then reruns the tests. This mode also offers multiple other options which can be used to either run all of the tests manually, or filter the tests by file name, test name, or by tests that have previously failed.
Running tests per folder
Tests can be filtered by folder, for example, running only bot-written client-side tests.
yarn test src/__tests__/BotWritten
Was this article helpful?