Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

fixup merge for pr #1809

Christopher Hiller829928e54346
diff --git a/lib/runnable.js b/lib/runnable.js
index 3291b28f..2492248e 100644
--- a/lib/runnable.js
+++ b/lib/runnable.js
@@ -8,7 +8,7 @@ var Pending = require('./pending');
var debug = require('debug')('mocha:runnable');
var milliseconds = require('./ms');
var utils = require('./utils');
-var inherits = utils.inherits;
+var create = require('lodash.create');
/**
* Save timer references to avoid Sinon interfering (see GH-237).
@@ -62,7 +62,9 @@ function Runnable(title, fn) {
/**
* Inherit from `EventEmitter.prototype`.
*/
-inherits(Runnable, EventEmitter);
+Runnable.prototype = create(EventEmitter.prototype, {
+ constructor: Runnable
+});
/**
* Set & get timeout `ms`.
diff --git a/lib/test.js b/lib/test.js
index 1e00c6f5..05d4ed86 100644
--- a/lib/test.js
+++ b/lib/test.js
@@ -31,7 +31,9 @@ function Test(title, fn) {
/**
* Inherit from `Runnable.prototype`.
*/
-inherits(Test, Runnable);
+Test.prototype = create(Runnable.prototype, {
+ constructor: Test
+});
Test.prototype.clone = function() {
var test = new Test(this.title, this.fn);
diff --git a/package.json b/package.json
index 453ff3aa..1ca94777 100644
--- a/package.json
+++ b/package.json
@@ -325,6 +325,7 @@
"glob": "7.0.5",
"growl": "1.9.2",
"json3": "3.3.2",
+ "lodash.create": "4.0.4",
"mkdirp": "0.5.1",
"pug": "2.0.0-beta3",
"supports-color": "3.1.2",