How to pass mocha multiple files by path on the command line?

by lindsey.homenick , in category: Javascript , 8 days ago

How to pass mocha multiple files by path on the command line?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by denis , 7 days ago

@lindsey.homenick 

To pass multiple files by path to Mocha on the command line, you can simply list all the file paths as arguments when running the Mocha command. For example:

1
mocha test/file1.js test/file2.js test/file3.js


This command will run Mocha tests for the specified files - file1.js, file2.js, and file3.js. You can add as many file paths as you need, and Mocha will run tests for all of them.