mocha 5.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,38 @@
1
+ # 5.0.1 / 2018-02-07
2
+
3
+ ...your garden-variety patch release.
4
+
5
+ :heart: Special thanks to [Wallaby.js](https://wallabyjs.com) for their continued support!
6
+
7
+ ## :bug: Fixes
8
+
9
+ - [#1838]: `--delay` now works with `.only()` ([@silviom])
10
+ - [#3119]: Plug memory leak present in v8 ([@boneskull])
11
+
12
+ ## :book: Documentation
13
+
14
+ - [#3132], [#3098]: Update `--glob` docs ([@outsideris])
15
+ - [#3212]: Update [Wallaby.,js](https://wallabyjs.com)-related docs ([@ArtemGovorov])
16
+ - [#3205]: Remove outdated cruft ([@boneskull])
17
+
18
+ ## :nut_and_bolt: Other
19
+
20
+ - [#3224]: Add proper Wallaby.js config ([@ArtemGovorov])
21
+ - [#3230]: Update copyright year ([@josephlin55555])
22
+
23
+ [#1838]: https://github.com/mochajs/mocha/issues/1838
24
+ [#3119]: https://github.com/mochajs/mocha/issues/3119
25
+ [#3132]: https://github.com/mochajs/mocha/issues/3132
26
+ [#3098]: https://github.com/mochajs/mocha/issues/3098
27
+ [#3212]: https://github.com/mochajs/mocha/pulls/3212
28
+ [#3205]: https://github.com/mochajs/mocha/pulls/3205
29
+ [#3224]: https://github.com/mochajs/mocha/pulls/3224
30
+ [#3230]: https://github.com/mochajs/mocha/pulls/3230
31
+ [@silviom]: https://github.com/silviom
32
+ [@outsideris]: https://github.com/outsideris
33
+ [@ArtemGovorov]: https://github.com/ArtemGovorov
34
+ [@josephlin55555]: https://github.com/josephlin55555
35
+
1
36
  # 5.0.0 / 2018-01-17
2
37
 
3
38
  Mocha starts off 2018 right by again dropping support for *unmaintained rubbish*.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2011-2017 JS Foundation and contributors, https://js.foundation
3
+ Copyright (c) 2011-2018 JS Foundation and contributors, https://js.foundation
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
package/lib/runnable.js CHANGED
@@ -53,7 +53,6 @@ function Runnable (title, fn) {
53
53
  this._slow = 75;
54
54
  this._enableTimeouts = true;
55
55
  this.timedOut = false;
56
- this._trace = new Error('done() called multiple times');
57
56
  this._retries = -1;
58
57
  this._currentRetry = 0;
59
58
  this.pending = false;
@@ -278,7 +277,13 @@ Runnable.prototype.run = function (fn) {
278
277
  return;
279
278
  }
280
279
  emitted = true;
281
- self.emit('error', err || new Error('done() called multiple times; stacktrace may be inaccurate'));
280
+ var msg = 'done() called multiple times';
281
+ if (err && err.message) {
282
+ err.message += " (and Mocha's " + msg + ')';
283
+ self.emit('error', err);
284
+ } else {
285
+ self.emit('error', new Error(msg));
286
+ }
282
287
  }
283
288
 
284
289
  // finished
@@ -287,8 +292,9 @@ Runnable.prototype.run = function (fn) {
287
292
  if (self.timedOut) {
288
293
  return;
289
294
  }
295
+
290
296
  if (finished) {
291
- return multiple(err || self._trace);
297
+ return multiple(err);
292
298
  }
293
299
 
294
300
  self.clearTimeout();
package/lib/runner.js CHANGED
@@ -810,11 +810,6 @@ Runner.prototype.run = function (fn) {
810
810
  var self = this;
811
811
  var rootSuite = this.suite;
812
812
 
813
- // If there is an `only` filter
814
- if (hasOnly(rootSuite)) {
815
- filterOnly(rootSuite);
816
- }
817
-
818
813
  fn = fn || function () {};
819
814
 
820
815
  function uncaught (err) {
@@ -822,6 +817,10 @@ Runner.prototype.run = function (fn) {
822
817
  }
823
818
 
824
819
  function start () {
820
+ // If there is an `only` filter
821
+ if (hasOnly(rootSuite)) {
822
+ filterOnly(rootSuite);
823
+ }
825
824
  self.started = true;
826
825
  self.emit('start');
827
826
  self.runSuite(rootSuite, function () {
package/mocha.js CHANGED
@@ -3965,7 +3965,6 @@ function Runnable (title, fn) {
3965
3965
  this._slow = 75;
3966
3966
  this._enableTimeouts = true;
3967
3967
  this.timedOut = false;
3968
- this._trace = new Error('done() called multiple times');
3969
3968
  this._retries = -1;
3970
3969
  this._currentRetry = 0;
3971
3970
  this.pending = false;
@@ -4190,7 +4189,13 @@ Runnable.prototype.run = function (fn) {
4190
4189
  return;
4191
4190
  }
4192
4191
  emitted = true;
4193
- self.emit('error', err || new Error('done() called multiple times; stacktrace may be inaccurate'));
4192
+ var msg = 'done() called multiple times';
4193
+ if (err && err.message) {
4194
+ err.message += " (and Mocha's " + msg + ')';
4195
+ self.emit('error', err);
4196
+ } else {
4197
+ self.emit('error', new Error(msg));
4198
+ }
4194
4199
  }
4195
4200
 
4196
4201
  // finished
@@ -4199,8 +4204,9 @@ Runnable.prototype.run = function (fn) {
4199
4204
  if (self.timedOut) {
4200
4205
  return;
4201
4206
  }
4207
+
4202
4208
  if (finished) {
4203
- return multiple(err || self._trace);
4209
+ return multiple(err);
4204
4210
  }
4205
4211
 
4206
4212
  self.clearTimeout();
@@ -5121,11 +5127,6 @@ Runner.prototype.run = function (fn) {
5121
5127
  var self = this;
5122
5128
  var rootSuite = this.suite;
5123
5129
 
5124
- // If there is an `only` filter
5125
- if (hasOnly(rootSuite)) {
5126
- filterOnly(rootSuite);
5127
- }
5128
-
5129
5130
  fn = fn || function () {};
5130
5131
 
5131
5132
  function uncaught (err) {
@@ -5133,6 +5134,10 @@ Runner.prototype.run = function (fn) {
5133
5134
  }
5134
5135
 
5135
5136
  function start () {
5137
+ // If there is an `only` filter
5138
+ if (hasOnly(rootSuite)) {
5139
+ filterOnly(rootSuite);
5140
+ }
5136
5141
  self.started = true;
5137
5142
  self.emit('start');
5138
5143
  self.runSuite(rootSuite, function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mocha",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "simple, flexible, fun test framework",
5
5
  "keywords": [
6
6
  "mocha",