Socket
Socket
Sign inDemoInstall

mocha

Package Overview
Dependencies
Maintainers
0
Versions
199
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocha - npm Package Compare versions

Comparing version 10.4.0 to 10.5.0

4

browser-entry.js

@@ -74,4 +74,4 @@ 'use strict';

if (e === 'uncaughtException') {
global.onerror = function (err, url, line) {
fn(new Error(err + ' (' + url + ':' + line + ')'));
global.onerror = function (msg, url, line, col, err) {
fn(err || new Error(msg + ' (' + url + ':' + line + ':' + col + ')'));
return !mocha.options.allowUncaught;

@@ -78,0 +78,0 @@ };

@@ -211,5 +211,6 @@ 'use strict';

* 1. Command-line args
* 2. RC file (`.mocharc.c?js`, `.mocharc.ya?ml`, `mocharc.json`)
* 3. `mocha` prop of `package.json`
* 4. default configuration (`lib/mocharc.json`)
* 2. `MOCHA_OPTIONS` environment variable.
* 3. RC file (`.mocharc.c?js`, `.mocharc.ya?ml`, `mocharc.json`)
* 4. `mocha` prop of `package.json`
* 5. default configuration (`lib/mocharc.json`)
*

@@ -235,2 +236,3 @@ * If a {@link module:lib/cli/one-and-dones.ONE_AND_DONE_ARGS "one-and-done" option} is present in the `argv` array, no external config files will be read.

const envConfig = parse(process.env.MOCHA_OPTIONS || '');
const rcConfig = loadRc(args);

@@ -248,3 +250,10 @@ const pkgConfig = loadPkgRc(args);

args = parse(args._, mocharc, args, rcConfig || {}, pkgConfig || {});
args = parse(
args._,
mocharc,
args,
envConfig,
rcConfig || {},
pkgConfig || {}
);

@@ -251,0 +260,0 @@ // recombine positional arguments and "spec"

@@ -57,3 +57,3 @@ /**

* The `ParallelBuffered` reporter is used by each worker process in "parallel"
* mode, by default. Instead of reporting to to `STDOUT`, etc., it retains a
* mode, by default. Instead of reporting to `STDOUT`, etc., it retains a
* list of events it receives and hands these off to the callback passed into

@@ -60,0 +60,0 @@ * {@link Mocha#run}. That callback will then return the data to the main

@@ -120,3 +120,3 @@ /**

*
* Practically, events emitted from `Runner` have a minumum of zero (0)
* Practically, events emitted from `Runner` have a minimum of zero (0)
* arguments-- (for example, {@link Runnable.constants.EVENT_RUN_BEGIN}) and a

@@ -123,0 +123,0 @@ * maximum of two (2) (for example,

@@ -13,3 +13,2 @@ 'use strict';

var utils = require('../utils');
var Progress = require('../browser/progress');
var escapeRe = require('escape-string-regexp');

@@ -42,3 +41,3 @@ var constants = require('../runner').constants;

'<ul id="mocha-stats">' +
'<li class="progress"><canvas width="40" height="40"></canvas></li>' +
'<li class="progress-contain"><progress class="progress-element" max="100" value="0"></progress><svg class="progress-ring"><circle class="ring-flatlight" stroke-dasharray="100%,0%"/><circle class="ring-highlight" stroke-dasharray="0%,100%"/></svg><div class="progress-text">0%</div></li>' +
'<li class="passes"><a href="javascript:void(0);">passes:</a> <em>0</em></li>' +

@@ -73,20 +72,12 @@ '<li class="failures"><a href="javascript:void(0);">failures:</a> <em>0</em></li>' +

var duration = items[3].getElementsByTagName('em')[0];
var canvas = stat.getElementsByTagName('canvas')[0];
var report = fragment('<ul id="mocha-report"></ul>');
var stack = [report];
var progress;
var ctx;
var progressText = items[0].getElementsByTagName('div')[0];
var progressBar = items[0].getElementsByTagName('progress')[0];
var progressRing = [
items[0].getElementsByClassName('ring-flatlight')[0],
items[0].getElementsByClassName('ring-highlight')[0]];
var progressRingRadius = null; // computed CSS unavailable now, so set later
var root = document.getElementById('mocha');
if (canvas.getContext) {
var ratio = window.devicePixelRatio || 1;
canvas.style.width = canvas.width;
canvas.style.height = canvas.height;
canvas.width *= ratio;
canvas.height *= ratio;
ctx = canvas.getContext('2d');
ctx.scale(ratio, ratio);
progress = new Progress();
}
if (!root) {

@@ -121,6 +112,2 @@ return error('#mocha div missing, add it to your document');

if (progress) {
progress.size(40);
}
runner.on(EVENT_SUITE_BEGIN, function (suite) {

@@ -241,5 +228,23 @@ if (suite.root) {

var percent = ((stats.tests / runner.total) * 100) | 0;
if (progress) {
progress.update(percent).draw(ctx);
progressBar.value = percent;
if (progressText) {
// setting a toFixed that is too low, makes small changes to progress not shown
// setting it too high, makes the progress text longer then it needs to
// to address this, calculate the toFixed based on the magnitude of total
var decimalPlaces = Math.ceil(Math.log10(runner.total / 100));
text(
progressText,
percent.toFixed(Math.min(Math.max(decimalPlaces, 0), 100)) + '%'
);
}
if (progressRing) {
var radius = parseFloat(getComputedStyle(progressRing[0]).getPropertyValue('r'));
var wholeArc = Math.PI * 2 * radius;
var highlightArc = percent * (wholeArc / 100);
// The progress ring is in 2 parts, the flatlight color and highlight color.
// Rendering both on top of the other, seems to make a 3rd color on the edges.
// To create 1 whole ring with 2 colors, both parts are inverse of the other.
progressRing[0].style['stroke-dasharray'] = `0,${highlightArc}px,${wholeArc}px`;
progressRing[1].style['stroke-dasharray'] = `${highlightArc}px,${wholeArc}px`;
}

@@ -246,0 +251,0 @@ // update stats

{
"name": "mocha",
"version": "10.4.0",
"version": "10.5.0",
"type": "commonjs",

@@ -56,3 +56,3 @@ "description": "simple, flexible, fun test framework",

"browser-stdout": "1.3.1",
"chokidar": "3.5.3",
"chokidar": "^3.5.3",
"debug": "4.3.4",

@@ -96,3 +96,2 @@ "diff": "5.0.0",

"globals": "^13.24.0",
"husky": "^4.2.5",
"hyperlink": "^5.0.4",

@@ -173,8 +172,3 @@ "jsdoc": "^3.6.7",

"webdriverio": "^7.33.0"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
}

@@ -8,3 +8,3 @@ <p align="center">

<p align="center">
<a href="https://github.com/mochajs/mocha/actions?query=workflow%3ATests+branch%3Amaster"><img src="https://github.com/mochajs/mocha/workflows/Tests/badge.svg?branch=master" alt="GitHub Actions Build Status"></a>
<a href="https://github.com/mochajs/mocha/actions?query=workflow%3ATests+branch%3Amain"><img src="https://github.com/mochajs/mocha/workflows/Tests/badge.svg?branch=main" alt="GitHub Actions Build Status"></a>
<a href="https://coveralls.io/github/mochajs/mocha"><img src="https://coveralls.io/repos/github/mochajs/mocha/badge.svg" alt="Coverage Status"></a>

@@ -27,6 +27,6 @@ <a href="https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmochajs%2Fmocha?ref=badge_shield"><img src="https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmochajs%2Fmocha.svg?type=shield" alt="FOSSA Status"></a>

- **[Documentation](https://mochajs.org)**
- **[Release Notes / History / Changes](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)**
- [Code of Conduct](https://github.com/mochajs/mocha/blob/master/.github/CODE_OF_CONDUCT.md)
- [Contributing](https://github.com/mochajs/mocha/blob/master/.github/CONTRIBUTING.md)
- [Development](https://github.com/mochajs/mocha/blob/master/.github/DEVELOPMENT.md)
- **[Release Notes / History / Changes](https://github.com/mochajs/mocha/blob/main/CHANGELOG.md)**
- [Code of Conduct](https://github.com/mochajs/mocha/blob/main/.github/CODE_OF_CONDUCT.md)
- [Contributing](https://github.com/mochajs/mocha/blob/main/.github/CONTRIBUTING.md)
- [Development](https://github.com/mochajs/mocha/blob/main/.github/DEVELOPMENT.md)
- [Discord](https://discord.gg/KeDn2uXhER) (ask questions here!)

@@ -64,3 +64,3 @@ - [Issue Tracker](https://github.com/mochajs/mocha/issues)

- Mocha could use a hand with [these issues](https://github.com/mochajs/mocha/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22)
- The [maintainer's handbook](https://github.com/mochajs/mocha/blob/master/MAINTAINERS.md) explains how things get done
- The [maintainer's handbook](https://github.com/mochajs/mocha/blob/main/MAINTAINERS.md) explains how things get done

@@ -75,4 +75,4 @@ Finally, come [chat with the maintainers on Discord](https://discord.gg/KeDn2uXhER) if you want to help with:

Copyright 2011-2022 OpenJS Foundation and contributors. Licensed [MIT](https://github.com/mochajs/mocha/blob/master/LICENSE).
Copyright 2011-2022 OpenJS Foundation and contributors. Licensed [MIT](https://github.com/mochajs/mocha/blob/main/LICENSE).
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmochajs%2Fmocha.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmochajs%2Fmocha?ref=badge_large)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc