Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 11, 2024 via pnpm

mocha 7.1.2

simple, flexible, fun test framework
Package summary
Share
5
issues
1
critical severity
vulnerability
1
3
high severity
vulnerability
1
meta
2
1
low severity
vulnerability
1
5
licenses
128
MIT
21
ISC
3
BSD-3-Clause
2
other licenses
BSD-2-Clause
1
Apache-2.0
1
Package created
8 Nov 2011
Version published
26 Apr 2020
Maintainers
6
Total deps
154
Direct deps
24
License
MIT

Issues

5

1 critical severity issue

critical
Recommendation: Upgrade to version 5.0.1 or later
via: yargs-unparser@1.6.0
Collapse
Expand

3 high severity issues

high
Recommendation: Upgrade to version 3.0.5 or later
via: glob@7.1.3 & others
via: debug@3.2.6
via: chokidar@3.3.0
Collapse
Expand

1 low severity issue

low
Recommendation: Upgrade to version 3.2.7 or later
via: debug@3.2.6
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
128 Packages, Including:
ansi-colors@3.2.3
ansi-regex@3.0.1
ansi-regex@4.1.1
ansi-styles@3.2.1
argparse@1.0.10
array-buffer-byte-length@1.0.1
array.prototype.reduce@1.0.7
arraybuffer.prototype.slice@1.0.3
available-typed-arrays@1.0.7
balanced-match@1.0.2
binary-extensions@2.3.0
brace-expansion@1.1.11
braces@3.0.2
call-bind@1.0.7
camelcase@5.3.1
chalk@2.4.2
chokidar@3.3.0
color-convert@1.9.3
color-name@1.1.3
concat-map@0.0.1
data-view-buffer@1.0.1
data-view-byte-length@1.0.1
data-view-byte-offset@1.0.0
debug@3.2.6
decamelize@1.2.0
define-data-property@1.1.4
define-properties@1.2.1
emoji-regex@7.0.3
es-abstract@1.23.3
es-array-method-boxes-properly@1.0.0
es-define-property@1.0.0
es-errors@1.3.0
es-object-atoms@1.0.0
es-set-tostringtag@2.0.3
es-to-primitive@1.2.1
escape-string-regexp@1.0.5
fill-range@7.0.1
find-up@3.0.0
for-each@0.3.3
fsevents@2.1.3
function-bind@1.1.2
function.prototype.name@1.1.6
functions-have-names@1.2.3
get-intrinsic@1.2.4
get-symbol-description@1.0.2
globalthis@1.0.3
gopd@1.0.1
growl@1.10.5
has-bigints@1.0.2
has-flag@3.0.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:
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.3
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
semver@5.7.2
set-blocking@2.0.0
which-module@2.0.1
which@1.3.1
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
3 Packages, Including:
diff@3.5.0
flat@4.1.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:
node-environment-flags@1.0.6
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

24
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
ansi-colors3.2.36.83 kBMIT
prod
browser-stdout1.3.11.4 kBISC
prod
chokidar3.3.024.97 kBMIT
prod
1
debug3.2.619.96 kBMIT
prod
1
1
diff3.5.0185.16 kBBSD-3-Clause
prod
escape-string-regexp1.0.51.54 kBMIT
prod
find-up3.0.02.22 kBMIT
prod
glob7.1.315.49 kBISC
prod
1
growl1.10.58.18 kBMIT
prod
he1.2.039.33 kBMIT
prod
js-yaml3.13.172.31 kBMIT
prod
log-symbols3.0.02.05 kBMIT
prod
minimatch3.0.411.16 kBISC
prod
1
mkdirp0.5.52.95 kBMIT
prod
ms2.1.12.96 kBMIT
prod
node-environment-flags1.0.66.49 kBApache-2.0
prod
object.assign4.1.011.93 kBMIT
prod
strip-json-comments2.0.12.22 kBMIT
prod
supports-color6.0.03.23 kBMIT
prod
which1.3.14.08 kBISC
prod
wide-align1.1.31.99 kBISC
prod
yargs-parser13.1.215.09 kBISC
prod
yargs-unparser1.6.04.32 kBMIT
prod
1
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.