Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on Dec 9, 2023 via pnpm

mocha 8.2.1

simple, flexible, fun test framework
Package summary
Share
5
issues
3
high severity
vulnerability
1
meta
2
2
moderate severity
vulnerability
2
5
licenses
69
MIT
21
ISC
4
BSD-3-Clause
2
other licenses
BSD-2-Clause
1
Apache-2.0
1
Package created
8 Nov 2011
Version published
2 Nov 2020
Maintainers
4
Total deps
96
Direct deps
25
License
MIT

Issues

5

3 high severity issues

high
Recommendation: Upgrade to version 3.0.5 or later
via: glob@7.1.6 & others
via: debug@4.2.0
via: chokidar@3.4.3
Collapse
Expand

2 moderate severity issues

moderate
Recommendation: Upgrade to version 3.1.31 or later
via: nanoid@3.1.12
Recommendation: Upgrade to version 4.3.1 or later
via: debug@4.2.0
Collapse
Expand

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
69 Packages, Including:
ansi-colors@4.1.1
ansi-regex@3.0.1
ansi-regex@4.1.1
ansi-styles@3.2.1
ansi-styles@4.3.0
argparse@1.0.10
balanced-match@1.0.2
binary-extensions@2.2.0
brace-expansion@1.1.11
braces@3.0.2
camelcase@5.3.1
camelcase@6.3.0
chalk@4.1.2
chokidar@3.4.3
color-convert@1.9.3
color-convert@2.0.1
color-name@1.1.3
color-name@1.1.4
concat-map@0.0.1
debug@4.2.0
decamelize@1.2.0
decamelize@4.0.0
emoji-regex@7.0.3
escape-string-regexp@4.0.0
fill-range@7.0.1
find-up@3.0.0
find-up@5.0.0
fsevents@2.1.3
growl@1.10.5
has-flag@4.0.0
he@1.2.0
is-binary-path@2.1.0
is-extglob@2.1.1
is-fullwidth-code-point@2.0.0
is-glob@4.0.3
is-number@7.0.0
is-plain-obj@2.1.0
js-yaml@3.14.0
locate-path@3.0.0
locate-path@6.0.0
log-symbols@4.0.0
mocha@8.2.1
ms@2.1.2
nanoid@3.1.12
normalize-path@3.0.0
p-limit@2.3.0
p-limit@3.1.0
p-locate@3.0.0
p-locate@5.0.0
p-try@2.2.0

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
21 Packages, Including:
@ungap/promise-all-settled@1.1.2
anymatch@3.1.3
browser-stdout@1.3.1
cliui@5.0.0
fs.realpath@1.0.0
get-caller-file@2.0.5
glob-parent@5.1.2
glob@7.1.6
inflight@1.0.6
inherits@2.0.4
isexe@2.0.0
minimatch@3.0.4
once@1.4.0
require-main-filename@2.0.0
set-blocking@2.0.0
which-module@2.0.1
which@2.0.2
wide-align@1.1.3
wrappy@1.0.2
y18n@4.0.3
yargs-parser@13.1.2

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
4 Packages, Including:
diff@4.0.2
flat@5.0.2
serialize-javascript@5.0.1
sprintf-js@1.0.3

BSD 2-Clause "Simplified" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
esprima@4.0.1

Apache License 2.0

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
use-patent-claims
place-warranty
Cannot
hold-liable
use-trademark
Must
include-copyright
include-license
state-changes
include-notice
1 Packages, Including:
workerpool@6.0.2
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

25
All Dependencies CSV
β“˜ This is a list of mocha 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
@ungap/promise-all-settled1.1.21.95 kBISC
prod
ansi-colors4.1.17.99 kBMIT
prod
browser-stdout1.3.11.4 kBISC
prod
chokidar3.4.325.61 kBMIT
prod
1
debug4.2.012.28 kBMIT
prod
1
1
diff4.0.299.91 kBBSD-3-Clause
prod
escape-string-regexp4.0.01.97 kBMIT
prod
find-up5.0.03.72 kBMIT
prod
glob7.1.615.51 kBISC
prod
1
growl1.10.58.18 kBMIT
prod
he1.2.039.33 kBMIT
prod
js-yaml3.14.075.14 kBMIT
prod
log-symbols4.0.02.26 kBMIT
prod
minimatch3.0.411.16 kBISC
prod
1
ms2.1.22.95 kBMIT
prod
nanoid3.1.1211.78 kBMIT
prod
1
serialize-javascript5.0.16.09 kBBSD-3-Clause
prod
strip-json-comments3.1.12.78 kBMIT
prod
supports-color7.2.03.13 kBMIT
prod peer
which2.0.24.39 kBISC
prod
wide-align1.1.31.99 kBISC
prod
workerpool6.0.271.77 kBApache-2.0
prod
yargs-parser13.1.215.09 kBISC
prod
yargs-unparser2.0.05 kBMIT
prod
yargs13.3.262.09 kBMIT
prod

Visualizations

Frequently Asked Questions

What does mocha do?

Mocha is a simple, flexible, and fun JavaScript testing framework. It's widely utilized in both Node.js and browser development, with a reputation for being one of the most relied-upon modules on npm. Mocha enables developers to create robust and accurate tests for their JavaScript code, thereby facilitating identifications and corrections of errors or bugs early in the development process.

How do you use mocha?

Utilizing Mocha for JavaScript testing involves installing the package and writing test scripts. First, you have to install Mocha via npm by running the command npm install --save-dev mocha. After installation, a new test file can be created where your test cases will be written. Here's a simple usage example:

const assert = require('assert');
const myFunction = require('./myFunction');

describe('My Function Test', function() {
  it('should return true when input is 5', function() {
    assert.equal(myFunction(5), true);
  });

  it('should return false when input is 10', function() {
    assert.equal(myFunction(10), false);
  });
});

To run the test, add a test script in your package.json file that calls Mocha, and then execute it with the npm test command:

"scripts": {
    "test": "mocha"
}

Run npm test in your terminal to begin the testing process.

Where are the mocha docs?

The comprehensive documentation for Mocha is found on its official webpage, mochajs.org. The documentation provides a detailed guide on installation, API references, and examples of usage for different testing scenarios. For additional resources, you may also visit the Mocha GitHub page and explore the release notes, code of conduct, contribution guidelines, and direct interactions with the maintainer community.