Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mochajs/mocha
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.4.1
Choose a base ref
...
head repository: mochajs/mocha
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.4.2
Choose a head ref
  • 9 commits
  • 8 files changed
  • 5 contributors

Commits on Jan 15, 2016

  1. Have global exports be compatible with Web Workers

    Assigning to `window` only works in a normal browser environment;
    however, Web Workers don't have access to `window`. Instead, the global
    object inside Web Workers is `self`.
    
    Browserify ensures that `global` is present to all scripts by creating a
    shim reference to it using this logic:
    
        typeof global !== "undefined" ? global :
        typeof self !== "undefined" ? self :
        typeof window !== "undefined" ? window : {}
    
    Thus, if neither `global` nor `self` were originally present,
    `global === window` will be true.
    
    Web Workers compatibility was broken in a81e555.
    mislav committed Jan 15, 2016

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    95d7d5b View commit details

Commits on Jan 26, 2016

  1. Merge pull request #2053 from mislav/window-vs-global

    Have global exports be compatible with Web Workers
    danielstjules committed Jan 26, 2016

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a661e6c View commit details
  2. Copy the full SHA
    9f3774f View commit details
  3. Merge pull request #2072 from thedark1337/master

    Fix #2071: Removed color code to fix Chalk colors
    boneskull committed Jan 26, 2016
    Copy the full SHA
    eef307d View commit details
  4. Copy the full SHA
    d8ffcfb View commit details

Commits on Jan 27, 2016

  1. Merge pull request #2074 from gyandeeps/master

    Fix: reporters with chalk functions (fixes #2073)
    boneskull committed Jan 27, 2016
    Copy the full SHA
    f87395c View commit details
  2. Copy the full SHA
    337e863 View commit details
  3. rebuild

    boneskull committed Jan 27, 2016
    Copy the full SHA
    8aafbb5 View commit details
  4. Release v2.4.2

    boneskull committed Jan 27, 2016
    Copy the full SHA
    753a511 View commit details
Showing with 34 additions and 17 deletions.
  1. +12 −0 CHANGELOG.md
  2. +1 −0 README.md
  3. +1 −1 lib/reporters/base.js
  4. +4 −3 lib/reporters/landing.js
  5. +2 −1 lib/reporters/progress.js
  6. +11 −9 mocha.js
  7. +1 −1 package.json
  8. +2 −2 support/browser-entry.js
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
2.4.2 / 2016-01-26

* [#2053] - Fix web worker compatibility ([@mislav])
* [#2072] - Fix Windows color output ([@thedark1337])
* [#2073] - Fix colors in `progress` and `landing` reporters ([@gyandeeps])

[#2053]: https://github.com/mochajs/mocha/pull/2053
[#2072]: https://github.com/mochajs/mocha/pull/2072
[#2073]: https://github.com/mochajs/mocha/pull/2073
[@gyandeeps]: https://github.com/gyandeeps
[@thedark1337]: https://github.com/thedark1337

2.4.1 / 2016-01-26
==================

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@

## Links

- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Google Group](http://groups.google.com/group/mochajs)
- [Wiki](https://github.com/mochajs/mocha/wiki)
- Mocha [Extensions and reporters](https://github.com/mochajs/mocha/wiki)
2 changes: 1 addition & 1 deletion lib/reporters/base.js
Original file line number Diff line number Diff line change
@@ -105,7 +105,7 @@ var color = exports.color = function(type, str) {
if (!exports.useColors) {
return String(str);
}
return '\u001b[' + exports.colors[type](str) + '\u001b[0m';
return exports.colors[type](str);
};

/**
7 changes: 4 additions & 3 deletions lib/reporters/landing.js
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ var Base = require('./base');
var inherits = require('../utils').inherits;
var cursor = Base.cursor;
var color = Base.color;
var chalk = require('chalk');

/**
* Expose `Landing`.
@@ -17,19 +18,19 @@ exports = module.exports = Landing;
* Airplane color.
*/

Base.colors.plane = 0;
Base.colors.plane = chalk.white;

/**
* Airplane crash color.
*/

Base.colors['plane crash'] = 31;
Base.colors['plane crash'] = chalk.red;

/**
* Runway color.
*/

Base.colors.runway = 90;
Base.colors.runway = chalk.gray;

/**
* Initialize a new `Landing` reporter.
3 changes: 2 additions & 1 deletion lib/reporters/progress.js
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ var Base = require('./base');
var inherits = require('../utils').inherits;
var color = Base.color;
var cursor = Base.cursor;
var chalk = require('chalk');

/**
* Expose `Progress`.
@@ -17,7 +18,7 @@ exports = module.exports = Progress;
* General progress bar color.
*/

Base.colors.progress = 90;
Base.colors.progress = chalk.gray;

/**
* Initialize a new `Progress` bar test reporter.
20 changes: 11 additions & 9 deletions mocha.js
Original file line number Diff line number Diff line change
@@ -1735,7 +1735,7 @@ var color = exports.color = function(type, str) {
if (!exports.useColors) {
return String(str);
}
return '\u001b[' + exports.colors[type](str) + '\u001b[0m';
return exports.colors[type](str);
};

/**
@@ -2990,6 +2990,7 @@ var Base = require('./base');
var inherits = require('../utils').inherits;
var cursor = Base.cursor;
var color = Base.color;
var chalk = require('chalk');

/**
* Expose `Landing`.
@@ -3001,19 +3002,19 @@ exports = module.exports = Landing;
* Airplane color.
*/

Base.colors.plane = 0;
Base.colors.plane = chalk.white;

/**
* Airplane crash color.
*/

Base.colors['plane crash'] = 31;
Base.colors['plane crash'] = chalk.red;

/**
* Runway color.
*/

Base.colors.runway = 90;
Base.colors.runway = chalk.gray;

/**
* Initialize a new `Landing` reporter.
@@ -3076,7 +3077,7 @@ function Landing(runner) {
inherits(Landing, Base);

}).call(this,require('_process'))
},{"../utils":39,"./base":17,"_process":51}],27:[function(require,module,exports){
},{"../utils":39,"./base":17,"_process":51,"chalk":67}],27:[function(require,module,exports){
(function (process){
/**
* Module dependencies.
@@ -3557,6 +3558,7 @@ var Base = require('./base');
var inherits = require('../utils').inherits;
var color = Base.color;
var cursor = Base.cursor;
var chalk = require('chalk');

/**
* Expose `Progress`.
@@ -3568,7 +3570,7 @@ exports = module.exports = Progress;
* General progress bar color.
*/

Base.colors.progress = 90;
Base.colors.progress = chalk.gray;

/**
* Initialize a new `Progress` bar test reporter.
@@ -3640,7 +3642,7 @@ function Progress(runner, options) {
inherits(Progress, Base);

}).call(this,require('_process'))
},{"../utils":39,"./base":17,"_process":51}],32:[function(require,module,exports){
},{"../utils":39,"./base":17,"_process":51,"chalk":67}],32:[function(require,module,exports){
/**
* Module dependencies.
*/
@@ -12852,8 +12854,8 @@ Mocha.process = process;
* Expose mocha.
*/

window.Mocha = Mocha;
window.mocha = mocha;
global.Mocha = Mocha;
global.mocha = mocha;

}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../":1,"_process":51,"browser-stdout":40}]},{},[75]);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mocha",
"version": "2.4.1",
"version": "2.4.2",
"description": "simple, flexible, fun test framework",
"keywords": [
"mocha",
4 changes: 2 additions & 2 deletions support/browser-entry.js
Original file line number Diff line number Diff line change
@@ -157,5 +157,5 @@ Mocha.process = process;
* Expose mocha.
*/

window.Mocha = Mocha;
window.mocha = mocha;
global.Mocha = Mocha;
global.mocha = mocha;