How to Only Run Tests in a Single Mocha "describe()" Block?

To run all tests described in a single describe() block, you can simply call the .only() method on describe in the following way:

describe.only('...', function () {
  // only tests in this block will run...
});

Similarly, you can call only() on it as well if you wish to run a single test.


Hope you found this post useful. It was published . Please show your love and support by sharing this post.