Skip to content

Commit

Permalink
Merge commit '3b02d830c0c5f20c5be9acaa9ef45b824bcbf965' into v3.0.0
Browse files Browse the repository at this point in the history
* commit '3b02d830c0c5f20c5be9acaa9ef45b824bcbf965': (29 commits)
  Add cross-frame compatible Error checking for fail
  Remove moot `version` property from bower.json
  HISTORY: fix typo in 2.2.5
  HISTORY: improve 2.2.5 changelog
  removing duplicate flags adding additional iojs flags
  Prevent default browser behavior for failure/pass links
  Removes return statement irt mochajs#1700.
  Removes accidentally commited test.js
  Add support of --harmony_arrow_functions V8 option
  Release 2.2.5
  Upgrade jsdiff to v1.4.0
  fix 'location is not defined' error
  Update json-stream.js
  Sanity check: update fixtures/regression/issue-1327.js to be closer to orig test
  Fix diff colors
  use a valid SPDX license identifier
  Add integration tests
  Handling of error.htmlMessage in the HTML reporter
  Split message and stack into two separate variables
  fix(utils/stringify): fix issue mochajs#1660
  ...

Conflicts:
	test/acceptance/misc/asyncOnly.js
  • Loading branch information
boneskull committed Jun 30, 2015
2 parents cc3f3f9 + 3b02d83 commit 5c6d16f
Show file tree
Hide file tree
Showing 61 changed files with 1,213 additions and 482 deletions.
59 changes: 59 additions & 0 deletions HISTORY.md
@@ -1,3 +1,62 @@

2.2.5 / 2015-05-14
==================

* [#1699] - Upgrade jsdiff to v1.4.0 ([@nylen])
* [#1648] - fix diff background colors in the console ([@nylen])
* [#1327] - fix tests running twice, a regression issue. ([#1686], [@danielstjules])
* [#1675] - add integration tests ([@danielstjules])
* [#1682] - use a valid SPDX license identifier in package.json ([@kemitchell])
* [#1660] - fix assertion of invalid dates ([#1661], [@a8m])
* [#1241] - fix issue with multiline diffs appearing as single line ([#1655], [@a8m])

[#1699]: https://github.com/mochajs/mocha/issues/1699
[#1648]: https://github.com/mochajs/mocha/issues/1648
[#1327]: https://github.com/mochajs/mocha/issues/1327
[#1686]: https://github.com/mochajs/mocha/issues/1686
[#1675]: https://github.com/mochajs/mocha/issues/1675
[#1682]: https://github.com/mochajs/mocha/issues/1682
[#1660]: https://github.com/mochajs/mocha/issues/1660
[#1661]: https://github.com/mochajs/mocha/issues/1661
[#1241]: https://github.com/mochajs/mocha/issues/1241
[#1655]: https://github.com/mochajs/mocha/issues/1655
[@nylen]: https://github.com/nylen
[@danielstjules]: https://github.com/danielstjules
[@kemitchell]: https://github.com/kemitchell
[@a8m]: https://github.com/a8m

2.2.4 / 2015-04-08
==================

* Load mocha.opts in _mocha for now (close #1645)

2.2.3 / 2015-04-07
==================

* fix(reporter/base): string diff - issue #1241
* fix(reporter/base): string diff - issue #1241
* fix(reporter/base): don't show diffs for errors without expectation
* fix(reporter/base): don't assume error message is first line of stack
* improve: dry up reporter/base test
* fix(reporter/base): explicitly ignore showDiff #1614
* Add iojs to travis build
* Pass `--allow-natives-syntax` flag to node.
* Support --harmony_classes flag for io.js
* Fix 1556: Update utils.clean to handle newlines in func declarations
* Fix 1606: fix err handling in IE <= 8 and non-ES5 browsers
* Fix 1585: make _mocha executable again
* chore(package.json): add a8m as a contributor
* Fixed broken link on html-cov reporter
* support --es_staging flag
* fix issue where menu overlaps content.
* update contributors in package.json
* Remove trailing whitespace from reporter output
* Remove contributors list from readme
* log third-party reporter errors
* [Fix] Exclude not own properties when looping on options
* fix: support node args in mocha.opts (close #1573)
* fix(reporter/base): string diff - issue #1241

2.2.1 / 2015-03-09
==================

Expand Down
60 changes: 4 additions & 56 deletions Makefile
Expand Up @@ -36,7 +36,7 @@ lib-cov:

test: test-unit

test-all: test-bdd test-tdd test-qunit test-exports test-unit test-grep test-jsapi test-compilers test-sort test-glob test-requires test-reporters test-only test-failing test-regression
test-all: test-bdd test-tdd test-qunit test-exports test-unit test-integration test-jsapi test-compilers test-glob test-requires test-reporters test-only

test-jsapi:
@node test/jsapi
Expand All @@ -48,25 +48,10 @@ test-unit:
--growl \
test/*.js

test-regression: test-outputs/issue1327/case-out.json
test-integration:
@./bin/mocha \
--reporter $(REPORTER) \
test/regression/issue*/control.js

test-outputs/issue1327/case-out.json: test/regression/issue1327/case.js
@mkdir -p $(dir $@) || true
@./bin/mocha --reporter json $< > $@ || true

test-failing:
./bin/mocha \
--reporter $(REPORTER) \
test/acceptance/failing > /dev/null 2>&1 ; \
failures="$$?" ; \
if [ "$$failures" != '4' ] ; then \
echo 'test-failing:' ; \
echo " expected 4 failing tests but saw $$failures" ; \
exit 1 ; \
fi
test/integration/*.js

test-compilers:
@./bin/mocha \
Expand Down Expand Up @@ -109,31 +94,6 @@ test-exports:
--ui exports \
test/acceptance/interfaces/exports

test-grep:
@./bin/mocha \
--reporter $(REPORTER) \
--grep fast \
test/acceptance/misc/grep

test-invert:
@./bin/mocha \
--reporter $(REPORTER) \
--grep slow \
--invert \
test/acceptance/misc/grep

test-bail:
@./bin/mocha \
--reporter $(REPORTER) \
--bail \
test/acceptance/misc/bail

test-async-only:
@./bin/mocha \
--reporter $(REPORTER) \
--async-only \
test/acceptance/misc/asyncOnly

test-glob:
@./test/acceptance/glob/glob.sh

Expand All @@ -142,12 +102,6 @@ test-reporters:
--reporter $(REPORTER) \
test/reporters/*.js

test-delay:
@./bin/mocha \
--reporter $(REPORTER) \
--delay \
test/delay/*.js

test-only:
@./bin/mocha \
--reporter $(REPORTER) \
Expand All @@ -164,12 +118,6 @@ test-only:
--ui qunit \
test/acceptance/misc/only/qunit

test-sort:
@./bin/mocha \
--reporter $(REPORTER) \
--sort \
test/acceptance/sort

test-mocha:
@./bin/mocha \
--reporter $(REPORTER) \
Expand Down Expand Up @@ -200,4 +148,4 @@ non-tty:
tm:
@open editors/$(TM_BUNDLE)

.PHONY: test-cov test-jsapi test-compilers watch test test-all test-bdd test-tdd test-qunit test-exports test-unit non-tty test-grep test-failing tm clean
.PHONY: test-cov test-jsapi test-compilers watch test test-all test-bdd test-tdd test-qunit test-exports test-unit test-integration non-tty tm clean
26 changes: 16 additions & 10 deletions bin/_mocha
Expand Up @@ -4,16 +4,17 @@
* Module dependencies.
*/

var program = require('commander')
, path = require('path')
, fs = require('fs')
, resolve = path.resolve
, exists = fs.existsSync || path.existsSync
, Mocha = require('../')
, utils = Mocha.utils
, join = path.join
, cwd = process.cwd()
, mocha = new Mocha;
var program = require('commander'),
path = require('path'),
fs = require('fs'),
resolve = path.resolve,
exists = fs.existsSync || path.existsSync,
Mocha = require('../'),
utils = Mocha.utils,
join = path.join,
cwd = process.cwd(),
getOptions = require('./options'),
mocha = new Mocha;

/**
* Save timer references to avoid Sinon interfering (see GH-237).
Expand Down Expand Up @@ -87,6 +88,7 @@ program
.option('--harmony-proxies', 'enable harmony proxies')
.option('--harmony_shipping', 'enable all shipped harmony fetaures (iojs)')
.option('--harmony_arrow_functions', 'enable "harmony arrow functions" (iojs)')
.option('--harmony_rest_parameters', 'enable "harmony rest parameters" (iojs)')
.option('--harmony_proxies', 'enable "harmony proxies" (iojs)')
.option('--harmony_classes', 'enable "harmony classes" (iojs)')
.option('--inline-diffs', 'display actual/expected differences inline within each string')
Expand Down Expand Up @@ -175,6 +177,10 @@ program.on('require', function(mod){
requires.push(mod);
});

// load mocha.opts into process.argv

getOptions();

// parse args

program.parse(process.argv);
Expand Down
42 changes: 18 additions & 24 deletions bin/mocha
Expand Up @@ -8,28 +8,12 @@
var spawn = require('child_process').spawn,
path = require('path'),
fs = require('fs'),
args = [path.join(__dirname, '_mocha')];
args = [path.join(__dirname, '_mocha')],
getOptions = require('./options');

// --opts
// load mocha.opts into process.argv

var optsPath = process.argv.indexOf('--opts') !== -1
? process.argv[process.argv.indexOf('--opts') + 1]
: 'test/mocha.opts';

try {
var opts = fs.readFileSync(optsPath, 'utf8')
.trim()
.split(/\s+/)
.filter(function(value) {
return value ? true : false;
});

process.argv = process.argv
.slice(0, 2)
.concat(opts.concat(process.argv.slice(2)));
} catch (err) {
// ignore
}
getOptions();

process.argv.slice(2).forEach(function(arg){
var flag = arg.split('=')[0];
Expand All @@ -52,17 +36,27 @@ process.argv.slice(2).forEach(function(arg){
case '--gc-global':
case '--harmony':
case '--es_staging':
case '--harmony-proxies':
case '--harmony_arrays':
case '--harmony_array_includes':
case '--harmony_arrow_functions':
case '--harmony_classes':
case '--harmony-collections':
case '--harmony_collections':
case '--harmony-generators':
case '--harmony_shipping':
case '--harmony_arrow_functions':
case '--harmony_generators':
case '--harmony_modules':
case '--harmony-proxies':
case '--harmony_proxies':
case '--harmony_classes':
case '--harmony_regexps':
case '--harmony_shipping':
case '--harmony_sloppy':
case '--harmony_rest_parameters':
case '--harmony_unicode':
case '--no-deprecation':
case '--prof':
case '--throw-deprecation':
case '--trace-deprecation':
case '--allow-natives-syntax':
args.unshift(arg);
break;
default:
Expand Down
36 changes: 36 additions & 0 deletions bin/options.js
@@ -0,0 +1,36 @@
/**
* Dependencies.
*/

var fs = require('fs');

/**
* Export `getOptions`.
*/

module.exports = getOptions;

/**
* Get options.
*/

function getOptions() {
var optsPath = process.argv.indexOf('--opts') !== -1
? process.argv[process.argv.indexOf('--opts') + 1]
: 'test/mocha.opts';

try {
var opts = fs.readFileSync(optsPath, 'utf8')
.trim()
.split(/\s+/)
.filter(function(value) {
return value ? true : false;
});

process.argv = process.argv
.slice(0, 2)
.concat(opts.concat(process.argv.slice(2)));
} catch (err) {
// ignore
}
}
3 changes: 1 addition & 2 deletions bower.json
@@ -1,6 +1,5 @@
{
"name": "mocha",
"version": "2.2.1",
"homepage": "http://mocha.github.io/mocha",
"description": "simple, flexible, fun test framework",
"authors": [
Expand Down Expand Up @@ -44,4 +43,4 @@
"tap"
],
"license": "MIT"
}
}
2 changes: 1 addition & 1 deletion component.json
@@ -1,6 +1,6 @@
{
"name": "mocha",
"version": "2.2.1",
"version": "2.2.5",
"repo": "mochajs/mocha",
"description": "simple, flexible, fun test framework",
"keywords": [
Expand Down
8 changes: 4 additions & 4 deletions lib/reporters/base.js
Expand Up @@ -66,8 +66,8 @@ exports.colors = {
, 'green': 32
, 'light': 90
, 'diff gutter': 90
, 'diff added': 42
, 'diff removed': 41
, 'diff added': 32
, 'diff removed': 31
};

/**
Expand Down Expand Up @@ -189,8 +189,8 @@ exports.list = function(failures){
if (err.showDiff !== false && sameType(actual, expected)
&& expected !== undefined) {

if ('string' !== typeof actual) {
escape = false;
escape = false;
if (!(utils.isString(actual) && utils.isString(expected))) {
err.actual = actual = utils.stringify(actual);
err.expected = expected = utils.stringify(expected);
}
Expand Down

0 comments on commit 5c6d16f

Please sign in to comment.