mocha-compat 3.6.2 → 3.6.4

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/README.md CHANGED
@@ -1,3 +1,14 @@
1
+ # mocha-compat
2
+
3
+ This is mocha-compat, a fork of mocha maintained at https://github.com/kmalakoff/mocha-compat. This
4
+ is the 3.x line (based on mocha 3.5.3), supporting Node 0.10 through 26. Install it via the alias
5
+ `"mocha-compat-3": "npm:mocha-compat@^3.6.4"`, and use the bins `mocha-compat-3` / `_mocha-compat-3`.
6
+ The unhyphenated `mocha-compat` / `_mocha-compat` bins still work as transitional aliases for
7
+ consumers already on them. A 10.x line also exists, on branch `support/10.x`, published as
8
+ `"mocha-compat-10": "npm:mocha-compat@^10"` for Node 12.17+.
9
+
10
+ ---
11
+
1
12
 
2
13
 
3
14
  # Mocha needs YOU!
package/bin/_mocha-compat CHANGED
@@ -116,7 +116,7 @@ program
116
116
  .option('--forbid-only', 'causes test marked with only to fail the suite')
117
117
  .option('--forbid-pending', 'causes pending tests and test marked with skip to fail the suite');
118
118
 
119
- program._name = 'mocha-compat';
119
+ program._name = 'mocha-compat-3';
120
120
 
121
121
  // init command
122
122
 
@@ -427,10 +427,10 @@ if (program.watch) {
427
427
  process.exit(130);
428
428
  });
429
429
 
430
- var watchFiles = utils.files(cwd, [ 'js' ].concat(program.watchExtensions));
430
+ var watchFiles = utils.files(cwd, ['js'].concat(program.watchExtensions));
431
431
  var runAgain = false;
432
432
 
433
- loadAndRun = function loadAndRun () {
433
+ loadAndRun = function loadAndRun() {
434
434
  try {
435
435
  mocha.files = files;
436
436
  runAgain = false;
@@ -445,7 +445,7 @@ if (program.watch) {
445
445
  }
446
446
  };
447
447
 
448
- purge = function purge () {
448
+ purge = function purge() {
449
449
  watchFiles.forEach(function (file) {
450
450
  delete require.cache[file];
451
451
  });
@@ -453,7 +453,7 @@ if (program.watch) {
453
453
 
454
454
  loadAndRun();
455
455
 
456
- rerun = function rerun () {
456
+ rerun = function rerun() {
457
457
  purge();
458
458
  stop();
459
459
  if (!program.grep) {
@@ -474,19 +474,19 @@ if (program.watch) {
474
474
  }
475
475
  });
476
476
  } else {
477
- // load
477
+ // load
478
478
 
479
479
  mocha.files = files;
480
480
  runner = mocha.run(program.exit ? exit : exitLater);
481
481
  }
482
482
 
483
- function exitLater (code) {
483
+ function exitLater(code) {
484
484
  process.on('exit', function () {
485
485
  process.exit(Math.min(code, 255));
486
486
  });
487
487
  }
488
488
 
489
- function exit (code) {
489
+ function exit(code) {
490
490
  var clampedCode = Math.min(code, 255);
491
491
 
492
492
  // Eagerly set the process's exit code in case stream.write doesn't
@@ -496,7 +496,7 @@ function exit (code) {
496
496
  // flush output for Node.js Windows pipe bug
497
497
  // https://github.com/joyent/node/issues/6247 is just one bug example
498
498
  // https://github.com/visionmedia/mocha/issues/333 has a good discussion
499
- function done () {
499
+ function done() {
500
500
  if (!(draining--)) {
501
501
  process.exit(clampedCode);
502
502
  }
@@ -527,7 +527,7 @@ process.on('SIGINT', function () {
527
527
  * Parse list.
528
528
  */
529
529
 
530
- function list (str) {
530
+ function list(str) {
531
531
  return str.split(/ *, */);
532
532
  }
533
533
 
@@ -535,7 +535,7 @@ function list (str) {
535
535
  * Hide the cursor.
536
536
  */
537
537
 
538
- function hideCursor () {
538
+ function hideCursor() {
539
539
  process.stdout.write('\u001b[?25l');
540
540
  }
541
541
 
@@ -543,7 +543,7 @@ function hideCursor () {
543
543
  * Show the cursor.
544
544
  */
545
545
 
546
- function showCursor () {
546
+ function showCursor() {
547
547
  process.stdout.write('\u001b[?25h');
548
548
  }
549
549
 
@@ -551,7 +551,7 @@ function showCursor () {
551
551
  * Stop play()ing.
552
552
  */
553
553
 
554
- function stop () {
554
+ function stop() {
555
555
  process.stdout.write('\u001b[2K');
556
556
  clearInterval(play.timer);
557
557
  }
@@ -560,7 +560,7 @@ function stop () {
560
560
  * Play the given array of strings.
561
561
  */
562
562
 
563
- function play (arr, interval) {
563
+ function play(arr, interval) {
564
564
  var len = arr.length;
565
565
  interval = interval || 100;
566
566
  var i = 0;
package/index.js CHANGED
@@ -1,6 +1,3 @@
1
1
  'use strict';
2
2
 
3
- var mock = require('mock-require-lazy');
4
- mock('glob', require('./vendor/glob/glob'));
5
-
6
3
  module.exports = require('./lib/mocha');
package/lib/utils.js CHANGED
@@ -10,7 +10,7 @@ var JSON = require('json3');
10
10
  var basename = require('path').basename;
11
11
  var debug = require('debug')('mocha:watch');
12
12
  var exists = require('fs').existsSync || require('path').existsSync;
13
- var glob = require('glob');
13
+ var glob = require('../vendor/glob/glob.js');
14
14
  var path = require('path');
15
15
  var join = path.join;
16
16
  var readdirSync = require('fs').readdirSync;
package/mocha.js CHANGED
@@ -6005,7 +6005,7 @@ var JSON = require('json3');
6005
6005
  var basename = require('path').basename;
6006
6006
  var debug = require('debug')('mocha:watch');
6007
6007
  var exists = require('fs').existsSync || require('path').existsSync;
6008
- var glob = require('glob');
6008
+ var glob = require('./vendor/glob/glob.js');
6009
6009
  var path = require('path');
6010
6010
  var join = path.join;
6011
6011
  var readdirSync = require('fs').readdirSync;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mocha-compat",
3
- "version": "3.6.2",
3
+ "version": "3.6.4",
4
4
  "description": "This is a fork of mocha 3.5.3 to upgrade dependencies to retain support for Node >=0.8 and resolve npm audit issues. Replace mocha-compat wherever you use mocha so they can be used side by side",
5
5
  "keywords": [
6
6
  "mocha",
@@ -288,11 +288,17 @@
288
288
  "license": "MIT",
289
289
  "repository": {
290
290
  "type": "git",
291
- "url": "https://github.com/mochajs/mocha.git"
291
+ "url": "git+https://github.com/kmalakoff/mocha-compat.git"
292
292
  },
293
+ "bugs": {
294
+ "url": "https://github.com/kmalakoff/mocha-compat/issues"
295
+ },
296
+ "homepage": "https://github.com/kmalakoff/mocha-compat#readme",
293
297
  "bin": {
294
- "mocha-compat": "./bin/mocha-compat",
295
- "_mocha-compat": "./bin/_mocha-compat"
298
+ "mocha-compat-3": "bin/mocha-compat",
299
+ "_mocha-compat-3": "bin/_mocha-compat",
300
+ "mocha-compat": "bin/mocha-compat",
301
+ "_mocha-compat": "bin/_mocha-compat"
296
302
  },
297
303
  "engines": {
298
304
  "node": ">= 0.10.x",
@@ -315,10 +321,9 @@
315
321
  "inherits": "2",
316
322
  "is-absolute": "^1.0.0",
317
323
  "json3": "^3.3.2",
318
- "lodash.create": "^3.1.1",
324
+ "lodash.create": "^4.2.0",
319
325
  "minimatch": "^3.1.2",
320
326
  "mkdirp": "^0.5.5",
321
- "mock-require-lazy": "^1.0.1",
322
327
  "once": "^1.3.0",
323
328
  "supports-color": "^3.1.2",
324
329
  "wrappy": "^1.0.2"
@@ -371,6 +376,5 @@
371
376
  "path": false,
372
377
  "supports-color": false
373
378
  },
374
- "homepage": "https://mochajs.org",
375
379
  "logo": "https://cldup.com/S9uQ-cOLYz.svg"
376
380
  }
@@ -18,17 +18,17 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "fs.realpath": "^1.0.0",
21
- "inflight": "^1.0.4",
21
+ "inflight": "^1.0.6",
22
22
  "inherits": "2",
23
- "minimatch": "^5.0.1",
24
- "once": "^1.3.0"
23
+ "minimatch": "^10.0.3",
24
+ "once": "^1.4.0"
25
25
  },
26
26
  "devDependencies": {
27
- "memfs": "^3.2.0",
28
- "mkdirp": "0",
29
- "rimraf": "^2.2.8",
30
- "tap": "^16.0.1",
31
- "tick": "0.0.6"
27
+ "memfs": "^4.17.2",
28
+ "mkdirp": "3",
29
+ "rimraf": "^6.0.1",
30
+ "tap": "^21.1.0",
31
+ "tick": "0.1.1"
32
32
  },
33
33
  "tap": {
34
34
  "before": "test/00-setup.js",
@@ -7,11 +7,11 @@
7
7
  "inflight.js"
8
8
  ],
9
9
  "dependencies": {
10
- "once": "^1.3.0",
10
+ "once": "^1.4.0",
11
11
  "wrappy": "1"
12
12
  },
13
13
  "devDependencies": {
14
- "tap": "^7.1.2"
14
+ "tap": "^21.1.0"
15
15
  },
16
16
  "scripts": {
17
17
  "test": "tap test.js --100"