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.5
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.5.1
Choose a head ref
Loading
Showing with 6,040 additions and 4,732 deletions.
  1. +1 −0 .mailmap
  2. +2 −0 .npmignore
  3. +35 −14 .travis.yml
  4. +91 −0 CHANGELOG.md
  5. +45 −5 Makefile
  6. +74 −2 README.md
  7. BIN assets/mocha-banner-192.png
  8. +160 −0 assets/mocha-banner.svg
  9. BIN assets/mocha-logo-128.png
  10. BIN assets/mocha-logo-192.png
  11. BIN assets/mocha-logo-64.png
  12. +125 −0 assets/mocha-logo.svg
  13. +1 −20 bin/_mocha
  14. +1 −0 bin/mocha
  15. +6 −1 {support → }/browser-entry.js
  16. +131 −0 karma.conf.js
  17. +2 −2 lib/browser/events.js
  18. +1 −1 lib/interfaces/bdd.js
  19. +1 −1 lib/interfaces/common.js
  20. +1 −1 lib/interfaces/exports.js
  21. +1 −1 lib/interfaces/tdd.js
  22. +17 −16 lib/mocha.js
  23. +2 −2 lib/reporters/base.js
  24. +2 −2 lib/reporters/html.js
  25. +1 −1 lib/reporters/xunit.js
  26. +13 −2 lib/runnable.js
  27. +2 −7 lib/runner.js
  28. +13 −7 lib/suite.js
  29. +0 −1 lib/test.js
  30. +16 −6 lib/utils.js
  31. +9 −0 mocha.css
  32. +4,780 −4,349 mocha.js
  33. +127 −68 package.json
  34. +0 −11 scripts/ensure-compatible-npm.sh
  35. +21 −0 scripts/upgrade-npm.js
  36. +9 −9 test/acceptance/context.js
  37. +1 −1 test/acceptance/http.js
  38. +17 −19 test/acceptance/interfaces/bdd.js
  39. +6 −6 test/acceptance/interfaces/exports.js
  40. +9 −9 test/acceptance/interfaces/qunit.js
  41. +16 −17 test/acceptance/interfaces/tdd.js
  42. +56 −0 test/acceptance/lookup-files.js
  43. +3 −3 test/acceptance/misc/only/bdd.js
  44. +3 −3 test/acceptance/misc/only/tdd.js
  45. +4 −4 test/acceptance/require/require.js
  46. +1 −1 test/acceptance/root.js
  47. +1 −1 test/acceptance/test.coffee
  48. +17 −20 test/acceptance/throw.js
  49. +117 −119 test/acceptance/utils.js
  50. +4 −0 test/browser-fixtures/bdd.js
  51. +4 −0 test/browser-fixtures/exports.js
  52. +4 −0 test/browser-fixtures/qunit.js
  53. +4 −0 test/browser-fixtures/tdd.js
  54. +1 −0 test/fixture-expect.js
  55. +1 −0 test/mocha.opts
  56. +43 −0 test/reporters/base.js
  57. +5 −0 test/suite.js
  58. +21 −0 test/test.js
  59. +12 −0 test/utils.js
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ Travis Jeffery <tj@travisjeffery.com> Dr. Travis Jeffery <tj@travisjeffery.com
Christopher Hiller <boneskull@boneskull.com> Christopher Hiller <chiller@badwing.com>
David da Silva Contín <dasilvacontin@gmail.com> David da Silva <daviddasilvacontin@me.com>
David da Silva Contín <dasilvacontin@gmail.com> David da Silva <dasilvacontin@gmail.com>
David da Silva Contín <dasilvacontin@gmail.com> <daviddasilvacontin@gmail.com>
Ariel Mashraki <ariel@mashraki.co.il> Ariel Mashraki <ariel@codeoasis.com>
Ariel Mashraki <ariel@mashraki.co.il> Ariel Mashraki <ariel.mashraki@ironsrc.com>
Forbes Lindesay <forbes@lindesay.co.uk> Forbes Lindesay <fpfl2@cam.ac.uk>
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
assets/

49 changes: 35 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,42 @@
# in order to use 'trusty' dist, need this.
# see https://docs.travis-ci.com/user/trusty-ci-environment/
sudo: required

# trust dist provides a modern build chain (as opposed to 'precise' dist)
# which absolves us from having to install compilers and stuff
dist: trusty

language: node_js
env:
global:
- CXX=g++-4.8

matrix:
include:
- node_js: '6'
env: TARGET="clean lint test-node test-browser"
- node_js: '5'
env: TARGET=test-node
- node_js: '4'
env: TARGET=test-node
- node_js: 'iojs'
env: TARGET=test-node
- node_js: '0.12'
env: TARGET=test-node
- node_js: '0.11'
env: TARGET=test-node
- node_js: '0.10'
env: TARGET=test-node
- node_js: '0.8'
env: TARGET=test-node

before_install:
- ./scripts/ensure-compatible-npm.sh
script: travis_retry npm test
node_js:
- '5'
- '4'
- 'iojs'
- '0.12'
- '0.11'
- '0.10'
- '0.8'
sudo: false
# node 0.8 won't install our dev deps with an out-of-box npm;
# this upgrades it
- node ./scripts/upgrade-npm.js

script: travis_retry make $TARGET

notifications:
urls:
# for gitter
- secure: "EmycFlk48bUvOQ07mxnbcn6T+n3G4wVWuXgrDsUUp6EhJ9866wQK9i+qVhqogWuSEQrGoVaS/vpc/NEYxDP30BD/+nqgvOhVhLVEgtziI85imyV/oUVpArdW3AUmuzCrx7rQCivygjpBmWV9ZcUT5Km4qp1iQhuumy2WbplxrZ4="
on_success: change
on_failure: always
91 changes: 91 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,94 @@
# 2.5.1 / 2016-05-23

- Fix [to-iso-string](https://npmjs.com/package/to-iso-string) dependency ([@boneskull] via bd9450b)

Thanks @entertainyou, @SimenB, @just-paja for the heads-up.

# 2.5.0 / 2016-05-23

> This has been awhile coming! We needed to feel confident that the next release wouldn't break browser compatibility (e.g. the last few patch releases).
>
> ### Browser Tests in CI
>
> We now run unit tests against PhantomJS v1.x and an assortment of browsers on [SauceLabs](https://saucelabs.com), including:
> - Internet Explorer v8.0
> - Chrome (latest)
> - Firefox (latest)
> - Safari (latest)
> - Microsoft Edge (latest)
>
> To accomplish this, we now run Mocha's unit tests (and a handful of integration tests) via [Karma](https://npmjs.com/package/karma) and a modified [karma-mocha](https://npmjs.com/package/karma-mocha). Along the way, we had to solve issue [#880] (apologies to @mderijcke and @sukima who had PRs addressing this), as well as replace most usages of [should](https://npmjs.com/package/should) with [expect.js](https://npmjs.com/package/expect.js) for IE8.
>
> Going forward, when sending PRs, your code will *only* run against PhantomJS v1.x (and not hit SauceLabs) [because security](https://docs.travis-ci.com/user/pull-requests/#Security-Restrictions-when-testing-Pull-Requests).
>
> ### Node.js 6.x
> Node.js 6.x "just worked" before, but now it's in the CI matrix, so it's "officially" supported. Mocha *still retains support* for Node.js 0.8.x.
>
> ### "Minor" Release
> You'll see mostly bug fixes below, but also a couple features--as such, it's a "minor" release.
>
> ### TYVM
>
> Thanks to everyone who contributed, and our fabulous [sponsors and backers](https://opencollective.com/mochajs)!
- [#2079] - Add browser checks to CI; update [browserify](https://npmjs.com/package/browserify) to v13.0.0 ([@dasilvacontin], [@ScottFreeCode], [@boneskull] via c04c1d7, 0b1e9b3, 0dde0fa, f8a3d86, 9e8cbaa)
- [#880] - Make Mocha browserifyable ([@boneskull] via 524862b)
- [#2121] - Update [glob](https://npmjs.com/package/glob) to v3.2.11 ([@astorije] via 7920fc4)
- [#2126] - Fix dupe error messages in stack trace filter ([@Turbo87] via 4301caa)
- [#2109] - Fix certain diffs when objects cannot be coerced into primitives ([@joshlory] via 61fbb7f)
- [#1827] - Fix TWBS/`mocha.css` collisions ([@irnc] via 0543798)
- [#1760], [#1936] - Fix `this.skip()` in HTML reporter ([@mislav] via cb4248b)
- [#2115] - Fix exceptions thrown from hooks in HTML reporter ([@danielstjules] via e290bc0)
- [#2089] - Handle Symbol values in `util.stringify()` ([@ryym] via ea61d05)
- [#2097] - Fix diff for objects overriding `Object.prototype.hasOwnProperty` ([@mantoni] via b20fdfe)
- [#2101] - Properly handle non-string "messages" thrown from assertion libraries ([@jkimbo] via 9c41051)
- [#2124] - Update [growl](https://npmjs.com/package/growl) ([@benjamine] via 9ae6a85)
- [#2162], [#2205] - JSDoc fixes ([@OlegTsyba] via 8031f20, [@ScottFreeCode] via f83b1d9)
- [#2132] - Remove Growl-related cruft ([@julienw] via 00d6469)
- [#2172] - Add [OpenCollective](https://opencollective.com) badge, sponsors & backers ([@xdamman], [@boneskull] via caee94f)
- [#1841] - Add new logo, banner assets ([@dasilvacontin] via 00fd0e1)
- [#2214] - Update `README.md` header ([@dasilvacontin] via c0f9be2)
- [#2236] - Better checks for Node.js v0.8 compatibility in CI ([@dasilvacontin] via ba5637d)
- [#2239] - Add Node.js v6.x to CI matrix ([@boneskull] via 3904da4)

[#880]: https://github.com/mochajs/mocha/issues/880
[#1841]: https://github.com/mochajs/mocha/pull/1841
[#2239]: https://github.com/mochajs/mocha/issues/2239
[#2153]: https://github.com/mochajs/mocha/pull/2153
[#2214]: https://github.com/mochajs/mocha/pull/2214
[#2236]: https://github.com/mochajs/mocha/pull/2236
[#2079]: https://github.com/mochajs/mocha/issues/2079
[#2231]: https://github.com/mochajs/mocha/pull/2231
[#2089]: https://github.com/mochajs/mocha/issues/2089
[#2097]: https://github.com/mochajs/mocha/pull/2097
[#1760]: https://github.com/mochajs/mocha/issues/1760
[#1936]: https://github.com/mochajs/mocha/issues/1936
[#2115]: https://github.com/mochajs/mocha/pull/2115
[#1827]: https://github.com/mochajs/mocha/pull/1827
[#2101]: https://github.com/mochajs/mocha/pull/2101
[#2124]: https://github.com/mochajs/mocha/pull/2124
[#2109]: https://github.com/mochajs/mocha/issues/2109
[#2162]: https://github.com/mochajs/mocha/pull/2162
[#2132]: https://github.com/mochajs/mocha/issues/2132
[#2126]: https://github.com/mochajs/mocha/issues/2126
[#2121]: https://github.com/mochajs/mocha/issues/2121
[#2205]: https://github.com/mochajs/mocha/pull/2205
[#2172]: https://github.com/mochajs/mocha/pull/2172
[@xdamman]: https://github.com/xdamman
[@Turbo87]: https://github.com/Turbo87
[@OlegTsyba]: https://github.com/OlegTsyba
[@ryym]: https://github.com/ryym
[@mantoni]: https://github.com/mantoni
[@mislav]: https://github.com/mislav
[@irnc]: https://github.com/irnc
[@jkimbo]: https://github.com/jkimbo
[@benjamine]: https://github.com/benjamine
[@joshlory]: https://github.com/joshlory
[@julienw]: https://github.com/julienw
[@ScottFreeCode]: https://github.com/ScottFreeCode
[@astorije]: https://github.com/astorije
[@dasilvacontin]: https://github.com/dasilvacontin

2.4.5 / 2016-01-28
==================

50 changes: 45 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
BROWSERIFY := node_modules/.bin/browserify
ESLINT := node_modules/.bin/eslint
KARMA := node_modules/.bin/karma

REPORTER ?= spec
TM_BUNDLE = JavaScript\ mocha.tmbundle
SRC = $(shell find lib -name "*.js" -type f | sort)
TESTS = $(shell find test -name "*.js" -type f | sort)
SUPPORT = $(wildcard support/*.js)

all: mocha.js

mocha.js: $(SRC) $(SUPPORT)
@$(BROWSERIFY) ./support/browser-entry \
@printf "==> [Browser :: build]\n"
@$(BROWSERIFY) ./browser-entry \
--ignore 'fs' \
--ignore 'glob' \
--ignore 'jade' \
@@ -18,48 +21,75 @@ mocha.js: $(SRC) $(SUPPORT)
--exclude './lib-cov/mocha' > $@

clean:
@printf "==> [Clean]\n"
rm -f mocha.js
rm -rf test-outputs
rm -fr lib-cov
rm -rf lib-cov
rm -f coverage.html

test-cov: lib-cov
@printf "==> [Test :: Coverage]\n"
@COV=1 $(MAKE) test REPORTER=html-cov > coverage.html

lib-cov:
@printf "==> [Coverage]\n"
@rm -fr ./$@
@jscoverage lib $@

lint:
@printf "==> [Test :: Lint]\n"
@$(ESLINT) $(SRC)

test: lint test-unit
test-node: 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-all: lint 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-browser: test-browser-unit test-browser-bdd test-browser-qunit test-browser-tdd test-browser-exports

test: lint test-node test-browser

test-browser-unit: mocha.js
@printf "==> [Test :: Browser]\n"
@NODE_PATH=. $(KARMA) start

test-browser-bdd:
@printf "==> [Test :: Browser :: BDD]\n"
@MOCHA_UI=bdd $(MAKE) test-browser-unit

test-browser-qunit:
@printf "==> [Test :: Browser :: QUnit]\n"
@MOCHA_UI=qunit $(MAKE) test-browser-unit

test-browser-tdd:
@printf "==> [Test :: Browser :: TDD]\n"
@MOCHA_UI=tdd $(MAKE) test-browser-unit

test-jsapi:
@printf "==> [Test :: JS API]\n"
@node test/jsapi

test-unit:
@printf "==> [Test :: Unit]\n"
@./bin/mocha \
--reporter $(REPORTER) \
test/acceptance/*.js \
--growl \
test/*.js

test-integration:
@printf "==> [Test :: Integrations]\n"
@./bin/mocha \
--reporter $(REPORTER) \
test/integration/*.js

test-compilers:
@printf "==> [Test :: Compilers]\n"
@./bin/mocha \
--reporter $(REPORTER) \
--compilers coffee:coffee-script/register,foo:./test/compiler/foo \
test/acceptance/test.coffee \
test/acceptance/test.foo

test-requires:
@printf "==> [Test :: Requires]\n"
@./bin/mocha \
--reporter $(REPORTER) \
--compilers coffee:coffee-script/register \
@@ -70,38 +100,45 @@ test-requires:
test/acceptance/require/require.js

test-bdd:
@printf "==> [Test :: BDD]\n"
@./bin/mocha \
--reporter $(REPORTER) \
--ui bdd \
test/acceptance/interfaces/bdd

test-tdd:
@printf "==> [Test :: TDD]\n"
@./bin/mocha \
--reporter $(REPORTER) \
--ui tdd \
test/acceptance/interfaces/tdd

test-qunit:
@printf "==> [Test :: QUnit]\n"
@./bin/mocha \
--reporter $(REPORTER) \
--ui qunit \
test/acceptance/interfaces/qunit

test-exports:
@printf "==> [Test :: Exports]\n"
@./bin/mocha \
--reporter $(REPORTER) \
--ui exports \
test/acceptance/interfaces/exports

test-glob:
@printf "==> [Test :: Glob]\n"
@./test/acceptance/glob/glob.sh

test-reporters:
@printf "==> [Test :: Reporters]\n"
@./bin/mocha \
--reporter $(REPORTER) \
test/reporters/*.js

test-only:
@printf "==> [Test :: Only]\n"
@./bin/mocha \
--reporter $(REPORTER) \
--ui tdd \
@@ -123,11 +160,13 @@ test-only:
test/acceptance/misc/only/qunit

test-mocha:
@printf "==> [Test :: Mocha]\n"
@./bin/mocha \
--reporter $(REPORTER) \
test/mocha

non-tty:
@printf "==> [Test :: Non-TTY]\n"
@./bin/mocha \
--reporter dot \
test/acceptance/interfaces/bdd 2>&1 > /tmp/dot.out
@@ -150,6 +189,7 @@ non-tty:
@cat /tmp/spec.out

tm:
@printf "==> [TM]\n"
@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 test-integration non-tty tm clean
.PHONY: test-cov test-jsapi test-compilers watch test test-node test-bdd test-tdd test-qunit test-exports test-unit test-integration non-tty tm clean test-browser test-browser-unit test-browser-bdd test-browser-qunit test-browser-tdd test-browser-exports lint
Loading