Code testing tools always matter. It improves your code coverage and reduces your debugging. Silvie integrated with Jest to let your create and run your test as easy as possible.
You can find your test files in the
tests directory of your project root. If you don't have that directory, or you
want to create a new test, you can use the make command in Silvie CLI.
This command will create a file named
hello.test.js in the
tests directory of your project root, with the following
contents which is a test suite with an empty test:
Keep in mind that jest has been configured to look for files ending with
.test.ts in the whole project.
tests directory meant to keep test files in one place. So you can have your test files anywhere, and they will be
executed no matter where they are.
There is a simple command in Silvie CLI to run all tests in the project, called test command. This command will run the jest on your project and shows the testing result on the screen.
To learn more about writing tests, please read the docs on official jest website.