Categories
JavaScript Answers

How to run a single test using Jest?

Spread the love

To run a single test using Jest, we can run jest with the -t option.

For instance, we run:

jest -t 'order-test'

to run a test with the describe string set to 'order-test'.

In general, the format of the command is

jest -t '<describeString> <itString>'

Conclusion

To run a single test using Jest, we can run jest with the -t option.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published.