How To Install Mocha On Debian, Ubuntu, Arch, Kali, Fedora And Raspbian?

How To Install Mocha On Debian, Ubuntu, Arch, Kali, Fedora And Raspbian?

mocha

Execute Mocha JavaScript test runner.

Maintainer: Debian Javascript Maintainers



Section: web

Install mocha

  • Debian apt-get install mocha Click to copy
  • Ubuntu apt-get install mocha Click to copy
  • Arch Linux pacman -S mocha Click to copy
  • Kali Linux apt-get install mocha Click to copy
  • Fedora dnf install mocha Click to copy
  • Raspbian apt-get install mocha Click 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 copy
Run tests contained at a specific location:
mocha folder/with/testsClick to copy
Run tests that match a specific grep pattern:
mocha --grep ^regex$Click to copy
Run tests on changes to JavaScript files in the current directory and once initially:
mocha --watchClick to copy
Run 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.