Comparing version 9.1.2 to 9.1.3
@@ -212,6 +212,16 @@ 'use strict'; | ||
*/ | ||
global.Mocha = Mocha; | ||
global.mocha = mocha; | ||
// for bundlers: enable `import {describe, it} from 'mocha'` | ||
// `bdd` interface only | ||
// prettier-ignore | ||
[ | ||
'describe', 'context', 'it', 'specify', | ||
'xdescribe', 'xcontext', 'xit', 'xspecify', | ||
'before', 'beforeEach', 'afterEach', 'after' | ||
].forEach(function(key) { | ||
mocha[key] = global[key]; | ||
}); | ||
module.exports = mocha; |
@@ -13,3 +13,2 @@ 'use strict'; | ||
constants: utilsConstants, | ||
createMap, | ||
defineConstants, | ||
@@ -96,12 +95,2 @@ getMochaID, | ||
this.reset(); | ||
this.on('newListener', function(event) { | ||
if (deprecatedEvents[event]) { | ||
errors.deprecate( | ||
'Event "' + | ||
event + | ||
'" is deprecated. Please let the Mocha team know about your use case: https://git.io/v6Lwm' | ||
); | ||
} | ||
}); | ||
} | ||
@@ -619,3 +608,3 @@ | ||
/** | ||
* Event emitted after a test file has been loaded Not emitted in browser. | ||
* Event emitted after a test file has been loaded. Not emitted in browser. | ||
*/ | ||
@@ -632,3 +621,3 @@ EVENT_FILE_POST_REQUIRE: 'post-require', | ||
/** | ||
* Event emitted when `global.run()` is called (use with `delay` option) | ||
* Event emitted when `global.run()` is called (use with `delay` option). | ||
*/ | ||
@@ -638,43 +627,41 @@ EVENT_ROOT_SUITE_RUN: 'run', | ||
/** | ||
* Namespace for collection of a `Suite`'s "after all" hooks | ||
* Namespace for collection of a `Suite`'s "after all" hooks. | ||
*/ | ||
HOOK_TYPE_AFTER_ALL: 'afterAll', | ||
/** | ||
* Namespace for collection of a `Suite`'s "after each" hooks | ||
* Namespace for collection of a `Suite`'s "after each" hooks. | ||
*/ | ||
HOOK_TYPE_AFTER_EACH: 'afterEach', | ||
/** | ||
* Namespace for collection of a `Suite`'s "before all" hooks | ||
* Namespace for collection of a `Suite`'s "before all" hooks. | ||
*/ | ||
HOOK_TYPE_BEFORE_ALL: 'beforeAll', | ||
/** | ||
* Namespace for collection of a `Suite`'s "before all" hooks | ||
* Namespace for collection of a `Suite`'s "before each" hooks. | ||
*/ | ||
HOOK_TYPE_BEFORE_EACH: 'beforeEach', | ||
// the following events are all deprecated | ||
/** | ||
* Emitted after an "after all" `Hook` has been added to a `Suite`. Deprecated | ||
* Emitted after a child `Suite` has been added to a `Suite`. | ||
*/ | ||
EVENT_SUITE_ADD_SUITE: 'suite', | ||
/** | ||
* Emitted after an "after all" `Hook` has been added to a `Suite`. | ||
*/ | ||
EVENT_SUITE_ADD_HOOK_AFTER_ALL: 'afterAll', | ||
/** | ||
* Emitted after an "after each" `Hook` has been added to a `Suite` Deprecated | ||
* Emitted after an "after each" `Hook` has been added to a `Suite`. | ||
*/ | ||
EVENT_SUITE_ADD_HOOK_AFTER_EACH: 'afterEach', | ||
/** | ||
* Emitted after an "before all" `Hook` has been added to a `Suite` Deprecated | ||
* Emitted after an "before all" `Hook` has been added to a `Suite`. | ||
*/ | ||
EVENT_SUITE_ADD_HOOK_BEFORE_ALL: 'beforeAll', | ||
/** | ||
* Emitted after an "before each" `Hook` has been added to a `Suite` Deprecated | ||
* Emitted after an "before each" `Hook` has been added to a `Suite`. | ||
*/ | ||
EVENT_SUITE_ADD_HOOK_BEFORE_EACH: 'beforeEach', | ||
/** | ||
* Emitted after a child `Suite` has been added to a `Suite`. Deprecated | ||
* Emitted after a `Test` has been added to a `Suite`. | ||
*/ | ||
EVENT_SUITE_ADD_SUITE: 'suite', | ||
/** | ||
* Emitted after a `Test` has been added to a `Suite`. Deprecated | ||
*/ | ||
EVENT_SUITE_ADD_TEST: 'test' | ||
@@ -684,18 +671,2 @@ } | ||
/** | ||
* @summary There are no known use cases for these events. | ||
* @desc This is a `Set`-like object having all keys being the constant's string value and the value being `true`. | ||
* @todo Remove eventually | ||
* @type {Object<string,boolean>} | ||
* @ignore | ||
*/ | ||
var deprecatedEvents = Object.keys(constants) | ||
.filter(function(constant) { | ||
return constant.substring(0, 15) === 'EVENT_SUITE_ADD'; | ||
}) | ||
.reduce(function(acc, constant) { | ||
acc[constants[constant]] = true; | ||
return acc; | ||
}, createMap()); | ||
Suite.constants = constants; |
{ | ||
"name": "mocha", | ||
"version": "9.1.2", | ||
"version": "9.1.3", | ||
"description": "simple, flexible, fun test framework", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3793784
55909