How to configure mocha to find all test files recursively?

by aniya.jaskolski , in category: Javascript , 3 months ago

How to configure mocha to find all test files recursively?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by larissa , 3 months ago

@aniya.jaskolski 

To configure Mocha to find all test files recursively, you can use the --recursive flag when running Mocha from the command line or add the following configuration to your Mocha options:

1
mocha --recursive


Alternatively, you can configure Mocha using a mocha.opts file with the following contents:

1
--recursive


This will tell Mocha to recursively search for test files in all subdirectories of the specified test directory.