How To Install Mocha On Debian, Ubuntu, Arch, Kali, Fedora And Raspbian?
Maintainer: Debian Javascript Maintainers
Email: [email protected] .
Website: https://mochajs.org
Section: web
Install mocha
-
Debian
apt-get install mochaClick to copy -
Ubuntu
apt-get install mochaClick to copy -
Arch Linux
pacman -S mochaClick to copy -
Kali Linux
apt-get install mochaClick to copy -
Fedora
dnf install mochaClick to copy -
Raspbian
apt-get install mochaClick to copy
Execute Mocha JavaScript test runner.
How to use mocha?
Below are few example commands for mocha that you can use in the terminal.
Run tests with default configuration or as configured in `mocha.opts`:mochaClick to copyRun tests contained at a specific location:mocha folder/with/testsClick to copyRun tests that match a specific grep pattern:mocha --grep ^regex$Click to copyRun tests on changes to JavaScript files in the current directory and once initially:mocha --watchClick to copyRun tests with a specific reporter:mocha --reporter reporterClick to copy
Installation of latest mocha command is available for Debian, Ubuntu, Arch, Kali, Fedora and Raspbian. You can copy the command for your OS from above and paste it into your terminal. Once you run the command it will download the 2026 latest package from the repository and install it in your computer/server.




