Testing your React Components/JS packages/NodeJS Apps/React Apps with Cantara works by simply executing the
ctra test <name> [jestParameters...]
All files ending in
.test.tsx (React) will be executed.
For testing React Components, the awesome React Testing Library is used.
Just have a look in the
packages/random-image-widget/src folder for an example.
If you for example want to run tests for the
random-image-widget component, simply execute:
ctra test random-image-widget
At the end of the
test command, you can append any Jest CLI option, e.g.
ctra test random-image-widget --watch