mocha
Advanced tools
Comparing version 6.0.0 to 6.0.1
@@ -298,3 +298,3 @@ 'use strict'; | ||
if (watch) { | ||
exports.watchRun(mocha, {extension, grep, ui}); | ||
exports.watchRun(mocha, {extension, grep, ui, files}); | ||
} else { | ||
@@ -301,0 +301,0 @@ exports.singleRun(mocha, {files, exit}); |
@@ -248,3 +248,3 @@ 'use strict'; | ||
.positional('spec', { | ||
default: ['test/'], | ||
default: ['test'], | ||
description: 'One or more files, directories, or globs to test', | ||
@@ -251,0 +251,0 @@ type: 'array' |
'use strict'; | ||
var Suite = require('../suite'); | ||
var utils = require('../utils'); | ||
var errors = require('../errors'); | ||
@@ -141,12 +140,3 @@ var createMissingArgumentError = errors.createMissingArgumentError; | ||
if (typeof opts.fn === 'function') { | ||
var result = opts.fn.call(suite); | ||
if (typeof result !== 'undefined') { | ||
utils.deprecate( | ||
'Suites ignore return values. Suite "' + | ||
suite.fullTitle() + | ||
'" in ' + | ||
suite.file + | ||
' returned a value; this may be a bug in your test code' | ||
); | ||
} | ||
opts.fn.call(suite); | ||
suites.shift(); | ||
@@ -153,0 +143,0 @@ } else if (typeof opts.fn === 'undefined' && !suite.pending) { |
@@ -263,3 +263,3 @@ 'use strict'; | ||
* @see {@link https://mochajs.org/#interfaces|Interface DSLs} | ||
* @param {string} [name=bdd] - Interface name. | ||
* @param {string|Function} [ui=bdd] - Interface name or class. | ||
* @returns {Mocha} this | ||
@@ -269,16 +269,21 @@ * @chainable | ||
*/ | ||
Mocha.prototype.ui = function(name) { | ||
name = name || 'bdd'; | ||
this._ui = exports.interfaces[name]; | ||
if (!this._ui) { | ||
try { | ||
this._ui = require(name); | ||
} catch (err) { | ||
throw createInvalidInterfaceError( | ||
'invalid interface ' + sQuote(name), | ||
name | ||
); | ||
Mocha.prototype.ui = function(ui) { | ||
var bindInterface; | ||
if (typeof ui === 'function') { | ||
bindInterface = ui; | ||
} else { | ||
ui = ui || 'bdd'; | ||
bindInterface = exports.interfaces[ui]; | ||
if (!bindInterface) { | ||
try { | ||
bindInterface = require(ui); | ||
} catch (err) { | ||
throw createInvalidInterfaceError( | ||
'invalid interface ' + sQuote(ui), | ||
ui | ||
); | ||
} | ||
} | ||
} | ||
this._ui = this._ui(this.suite); | ||
bindInterface(this.suite); | ||
@@ -285,0 +290,0 @@ this.suite.on(EVENT_FILE_PRE_REQUIRE, function(context) { |
{ | ||
"name": "mocha", | ||
"version": "6.0.0", | ||
"version": "6.0.1", | ||
"description": "simple, flexible, fun test framework", | ||
@@ -80,2 +80,3 @@ "keywords": [ | ||
"Brian Moore <guardbionic-github@yahoo.com>", | ||
"Brian Tomlin <tendonstrength@gmail.com>", | ||
"Brittany Moore <moore.brittanyann@gmail.com>", | ||
@@ -415,2 +416,3 @@ "Bryan Donovan <bdondo@gmail.com>", | ||
"Svetlana <39729453+Lana-Light@users.noreply.github.com>", | ||
"Szauka <33459309+Szauka@users.noreply.github.com>", | ||
"Tapiwa Kelvin <tapiwa@munzwa.tk>", | ||
@@ -520,6 +522,6 @@ "Ted Yavuzkurt <hello@TedY.io>", | ||
"devDependencies": { | ||
"@11ty/eleventy": "^0.6.0", | ||
"@11ty/eleventy": "^0.7.1", | ||
"@mocha/contributors": "^1.0.3", | ||
"@mocha/docdash": "^1.0.1", | ||
"assetgraph-builder": "^6.4.2", | ||
"@mocha/docdash": "^2.0.0", | ||
"assetgraph-builder": "^6.6.3", | ||
"browserify": "^16.2.3", | ||
@@ -532,8 +534,8 @@ "browserify-package-json": "^1.0.1", | ||
"cross-spawn": "^6.0.5", | ||
"eslint": "^5.10.0", | ||
"eslint-config-prettier": "^3.3.0", | ||
"eslint": "^5.14.1", | ||
"eslint-config-prettier": "^3.6.0", | ||
"eslint-config-semistandard": "^13.0.0", | ||
"eslint-config-standard": "^12.0.0", | ||
"eslint-plugin-import": "^2.14.0", | ||
"eslint-plugin-node": "^8.0.0", | ||
"eslint-plugin-import": "^2.16.0", | ||
"eslint-plugin-node": "^8.0.1", | ||
"eslint-plugin-prettier": "^3.0.0", | ||
@@ -544,3 +546,3 @@ "eslint-plugin-promise": "^4.0.1", | ||
"jsdoc": "^3.5.5", | ||
"karma": "^3.1.1", | ||
"karma": "^4.0.0", | ||
"karma-browserify": "^5.3.0", | ||
@@ -551,3 +553,3 @@ "karma-chrome-launcher": "^2.0.0", | ||
"karma-sauce-launcher": "^1.2.0", | ||
"lint-staged": "^8.1.0", | ||
"lint-staged": "^8.1.4", | ||
"markdown-it": "^8.4.2", | ||
@@ -563,9 +565,9 @@ "markdown-it-anchor": "^5.0.2", | ||
"nyc": "^13.3.0", | ||
"prettier": "^1.15.3", | ||
"prettier": "^1.16.4", | ||
"remark": "^10.0.1", | ||
"remark-github": "^7.0.5", | ||
"remark-github": "^7.0.6", | ||
"remark-inline-links": "^3.1.2", | ||
"rewiremock": "^3.12.3", | ||
"rimraf": "^2.5.2", | ||
"sinon": "^7.1.1", | ||
"sinon": "^7.2.4", | ||
"strip-ansi": "^5.0.0", | ||
@@ -577,5 +579,5 @@ "svgo": "^1.1.1", | ||
"unexpected-eventemitter": "^1.1.3", | ||
"unexpected-sinon": "^10.10.1", | ||
"unexpected-sinon": "^10.11.1", | ||
"uslug": "^1.0.4", | ||
"watchify": "^3.7.0" | ||
"watchify": "^3.11.1" | ||
}, | ||
@@ -582,0 +584,0 @@ "files": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
967427
31
24732