Developer Docs

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:

yarn test

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.

Image

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?

Thanks for your feedback!

If you would like to tell us more, please click on the link below to send us a message with more details.

Tool:

Generate

Iterate

Bot:

C#Bot

SpringBot

On this page

New to Codebots?

We know our software can be complicated, so we are always happy to have a chat if you have any questions.