Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for suppressing stack traces #1095

Closed
wants to merge 119 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
2afee4c
Add support for suppressing stack traces
tandrewnichols Jan 1, 2014
478791b
Merge upstream master
tandrewnichols Jul 15, 2014
4092f6d
Add test and cleanup loose %s
tandrewnichols Aug 13, 2014
d5e4d51
Respect err.showDiff, add Base reporter test (close #810)
mwolson Nov 8, 2013
10ee606
only write to stdout in reporters
sky-glenjamin Dec 5, 2013
5288ec9
Less re-rendering with progress reporter
Connorhd Mar 10, 2014
7e73537
#888 Fix for --watch+only() issue
startswithaj Mar 27, 2014
a6398ad
add support for reporter options
demmer May 17, 2014
425fe69
if a reporter has a .done method, call it before exiting
demmer May 17, 2014
de7fbdf
xunit reporter support for optionally writing to a file
demmer May 17, 2014
91f7395
Fix diffs of circular structures (close #1198, fix #1179)
travisjeffery Jul 18, 2014
006ada1
Strip commas from the JSON.stringify output before diffing
papandreou Jul 20, 2014
846766b
Add tests for #1182 (close #1182)
travisjeffery Jul 20, 2014
7a85507
Cleanup #1267
travisjeffery Jul 24, 2014
e8bafb3
Update history.md
travisjeffery Jul 24, 2014
ce5af16
1.21.0
travisjeffery Jul 24, 2014
23f8ae6
Suport ops path specify
nishigori Jul 22, 2014
82cb641
Update history.md
travisjeffery Jul 24, 2014
1664811
Fix getting timeout from Context (close #1282)
travisjeffery Jul 25, 2014
2329f04
bumping to 1.21.1 for missing build
Jul 27, 2014
d58cbb2
Revert "allow local modules to work as ui and reporters"
Jul 27, 2014
1df8b08
reverting "adding node_modules dir to use local modules for ui & repo…
Jul 27, 2014
061a8d7
bumping to 1.21.2
Jul 27, 2014
759ccf5
Add local uis and reporters (close #1288)
travisjeffery Jul 28, 2014
24349f2
Update history.md
travisjeffery Jul 28, 2014
42037bb
1.21.3
travisjeffery Jul 28, 2014
4c7e3f0
Update history.md
travisjeffery Jul 28, 2014
3cdf972
Issue 1294 - JSON reporter missing error reason
diogogmt Jul 28, 2014
780846b
Fix transforming errors to json in json reporter (#1295)
travisjeffery Jul 30, 2014
52b86a6
"maintainers" in package.json should probably be "contributors" as pe…
Jul 31, 2014
ec6c2e1
update coffee-script to 1.7.1
Jul 31, 2014
c3a698e
fix travis.yml; version names need double quotes
Jul 31, 2014
6958ce3
resolves #1296: evidently the order matters
Aug 5, 2014
35e296c
resolves #1300: passing 0 to timeout() will disable timeouts
Aug 5, 2014
744ba6e
Update coverage.jade
mrShturman Aug 5, 2014
307f03b
1.21.4
travisjeffery Aug 6, 2014
370bd7f
Update coverage.jade
ouhouhsami Aug 14, 2014
a40b38e
resolves #1300 again: timeout(0) will work at suite level
Aug 15, 2014
7aaf549
proving this.timeout(0) works in before()
Aug 23, 2014
53c3fd3
Never time out after calling enableTimeouts(false)
Rob--W Aug 24, 2014
4982ec1
added empty object to errorJSON() call to catch when no error is present
Aug 25, 2014
67fbfd9
resolves #1035: renaming options.long => options['long']
Aug 26, 2014
eba3628
Scoping highlighting tags to the mocha element
Aug 28, 2014
897e83e
Changes test reporter to spec for better reports on failing tests.
Aug 30, 2014
060793c
resolves #1329: ability to disable syntax highlighting
Aug 30, 2014
acbca8f
#1329 again: fixed boolean blunder
Aug 30, 2014
baf526b
resolves #1072: do not expect uncaught exception to be an object
Sep 5, 2014
32b6e16
resolves #1223: fix interaction with symbolic links
Aug 31, 2014
b4e002c
Fixes test for utils.lookupFiles.
Sep 6, 2014
1d98e85
Adds semicolon missing from pull-request.
Sep 6, 2014
8a10d8a
Replaces util.escapeRegexp by the escape-string-regexp package.
Sep 7, 2014
b70a34d
Sorts package.json dependencies alphabetically.
Sep 7, 2014
6e40db0
Bumps diff to 1.0.8.
Sep 7, 2014
a37ec24
Bumps commander to 2.3.0.
Sep 7, 2014
7598887
Bumps coffee-script to 1.8.0.
Sep 7, 2014
ece00ee
updating some deps
Sep 7, 2014
2882fee
Revert "Replaces util.escapeRegexp by the escape-string-regexp package."
Sep 7, 2014
aa19f72
Replaces escapeRegexp with the escape-string-regexp package.
Sep 7, 2014
ba413e2
Resolve #1235
kevinconway Sep 7, 2014
873b6e1
Checks in the regenered mocha.js with the correct requires.
Sep 7, 2014
d3266d9
Fix --recursive, broken by f0facd2e
domq Sep 9, 2014
c7b5e5d
Runner.prototype.uncaught: don't double-end runnables that already ha…
domq Aug 29, 2014
31bad7b
rm redundant var
zhiyelee Sep 11, 2014
19328c8
[reporter] Add `pending` field for json reporter
cybertk Sep 12, 2014
9acc13a
changed 'Catched' to 'Caught' in uncaught exception error handler mes…
omardelarosa Sep 12, 2014
4712f6a
.gitignore: ignore .patch and .diff files
Sep 13, 2014
f90194a
utils.js: correcting botched indentation in canonicalize()
Sep 13, 2014
d00bd54
HTML reporter: preserve query params when navigating to suites/tests
Sep 13, 2014
bbea7c4
Bumps escape-string-regexp to 1.0.2.
Sep 13, 2014
3f7965a
[reporter] Add test for pending tests of json-reporter
cybertk Sep 14, 2014
236c8fb
do not attempt to highlight syntax when non-HTML reporter is used
Sep 16, 2014
3907ac7
build
Sep 16, 2014
9a527f6
refac(_mocha.js): remove duplicate declaration
a8m Sep 18, 2014
8942361
refac(lib/*): add/remove semicolons, etc..
a8m Sep 21, 2014
5dd8289
fixing build for NodeJS v0.6.x
Sep 27, 2014
08daf97
add an .editorconfig
notslang Sep 29, 2014
9639e60
make project follow editorconfig rules
notslang Sep 29, 2014
4d0399f
replaced non-ANSI.SYS escape sequence in landing reporter, fixes #211
dasilvacontin Oct 8, 2014
5832b54
Release 1.21.5
travisjeffery Oct 11, 2014
cb43d65
bin: use `stdio: 'inherit'` for child process spawn
TooTallNate Oct 14, 2014
16fa751
Add 0.4 back to .travis.yml
travisjeffery Oct 16, 2014
412f052
Remove 0.4 from .travis.yml
travisjeffery Oct 17, 2014
3b0ddd5
resolves #1066: generate better async trace if done() is called multi…
Sep 5, 2014
7529108
update .editorconfig to respect trailing whitespace in markdown files
Oct 17, 2014
4e76858
#1190: add error message to failed test with json-stream reporter
Oct 17, 2014
7071e91
visionmedia->mochajs
cscott Oct 20, 2014
848e26c
updating package.json, bower.json, component.json for new repo url
Oct 21, 2014
50b98ba
tryna fix failed build
Oct 21, 2014
07948d1
update links to site
Oct 21, 2014
c2fc8a4
Release 2.0.0
travisjeffery Oct 22, 2014
dc3177b
resolves #1393: kill children with more effort on SIGINT
Oct 22, 2014
d35f6db
rebuild & bump to 2.0.1
Oct 23, 2014
5ba1ec9
update maintainers and contributors
Oct 23, 2014
8afc7ee
Update maintainers
travisjeffery Oct 30, 2014
0ad1478
Add slack room to readme
travisjeffery Oct 30, 2014
b2b0bd2
Fix slack link
travisjeffery Oct 30, 2014
0b965fa
add Slack notification to .travis.yml
Nov 2, 2014
0275c92
fix intermittent build failures (maybe). closes #1407
Oct 30, 2014
525dd09
add a CONTRIBUTING.md. closes #882
Nov 3, 2014
267aabe
Fix buffer diffs (closes #1132, closes #1433)
a8m Nov 17, 2014
0e4c549
add setImmediate/clearImmediate to globals; closes #1435
Nov 18, 2014
3b38f1b
fix bad markdown in CONTRIBUTING.md
Nov 18, 2014
8153eb8
fix more bad markdown in CONTRIBUTING.md
Nov 18, 2014
fff6a10
prefix/namespace for suite titles in markdown reporter, fixes #554
dasilvacontin Nov 11, 2014
780e050
compiler extensions are added as watched extensions, removed non-stan…
dasilvacontin Nov 9, 2014
8a58268
fix throwing undefined/null now makes tests fail, fixes #1395
dasilvacontin Nov 1, 2014
df2b610
after hooks now being called on failed tests when using bail, fixes #…
dasilvacontin Oct 31, 2014
2436b42
Tiny typo in comments fixed
RichardKnop Nov 27, 2014
064f951
Fix test
travisjeffery Nov 27, 2014
fb388f3
Preserve pathname when linking to individual tests
backspace Dec 11, 2014
56b67f5
improve diff behavior
Sep 13, 2014
7ffebdf
fix tests (whoops)
Dec 11, 2014
a31da2b
fix -t 0 behavior; closes #1446
Dec 11, 2014
8a16a00
modify .travis.yml: use travis_retry; closes #1449
Dec 11, 2014
edcd902
Use existing test URL builder in failed replay links
backspace Dec 12, 2014
47dc933
add .mailmap to fix "git shortlog" or "git summary" output
Dec 15, 2014
8171f76
rename Readme.md/History.md to README.md/HISTORY.md because neurotic
Dec 15, 2014
ce31031
update summary in README.md
Dec 15, 2014
36ffb56
Print colored output only to a tty
Nov 27, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

root = true

[*]
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab

[*.md]
trim_trailing_whitespace = false
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ coverage.html
lib-cov
.DS_Store
node_modules
test-outputs
*.sock
testing
_mocha.js
Expand All @@ -10,3 +11,5 @@ my-reporter.js
lib/browser/diff.js
.idea
*.iml
*.patch
*.diff
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TJ Holowaychuk <[email protected]>
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
language: node_js
script: travis_retry npm test
node_js:
- "0.11"
- 0.8
- 0.10
- '0.11'
- '0.10'
- '0.8'
notifications:
slack:
secure: Xov4Q/jpmTr6p5E/kYeC0HF1tWm0YqBWvCUbNuJiti3CtFpVmOwXEvxGFcvZNAXApEVrs1uhLZLifuL3oJ/TNdqzM5nT5jDGawPYgf8ly+fTaEiCpsRCdQhFLVqYoN671eyx7QILtre9b51SeaFVVksMrfTmvh4aKJCN01iuJm4=
49 changes: 49 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Contributing to Mocha

Hi! We could use your help. Let us help you help us. Or something.

## General

1. If you are looking for a place to begin, **please send PRs for bugfixes instead of new features**, and/or **look for issues labeled `PR PLEASE`.**

2. **Help with documentation and the wiki is always appreciated**.

3. Please **be courteous and constructive** when commenting on issues, commits, and pull requests.

## Bug Reports & Issues

1. When reporting a bug, please **provide steps to reproduce**. If possible, show code.

2. Please **show all code in JavaScript**. We don't all read `<insert-language-that-compiles-to-JavaScript-here>`. If you do not, you will be asked to.

3. Because Mocha works with many third-party libraries and tools, **ensure the bug you are reporting is actually within Mocha**.

4. If you report a bug, and it is inactive for a significant amount of time, it may be closed. **Please respond promptly to requests for more information**.

## Pull Requests

1. Before sending a large PR, it's recommended to **create an issue to propose the change**. Nobody wants to write a book of code and throw it away.

2. Because Mocha should be kept as maintainable as possible, its codebase must be kept slim. Historically, *most PRs for new features are not merged*. New features inevitably increase the size of the codebase, and thus reduce maintainability. Only features *deemed essential* are likely to be merged--this is at the discretion of the maintainer(s). If your PR for a feature is not merged, this doesn't necessarily mean your PR was a bad idea, wouldn't be used, or otherwise sucks. It just means **only essential PRs for new features are likely to be merged**.

3. Due to the above, before creating a PR for a new feature, **create an issue to propose the feature.**

4. Please **respect existing coding conventions**, whatever those may be.

5. If your PR has been waiting in limbo for some time, it's very helpful to **rebase against master**, which will make it easier to merge.

6. Please **add tests for new code**.

7. **Always run `npm test` before sending a PR.** If you break the tests, your PR will not be accepted until they are fixed.

## Source Control

1. Please **squash your commits** when sending a pull request. If you are unfamiliar with this process, see [this guide](https://help.github.com/articles/about-git-rebase/). If you have already pushed your changesets and are squashing thereafter, this may necessitate the use of a "force push". Please [read the docs](http://git-scm.com/docs/git-push) before you attempt this.

2. Please **follow the commit message conventions [outlined here](https://medium.com/code-adventures/git-conventions-a940ee20862d).**

## TL;DR

**Be kind, be diligent, look before you leap into a PR, and follow common community conventions**.

*- The Mocha Team*
66 changes: 66 additions & 0 deletions History.md → HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,69 @@
2.0.0 / 2014-10-21
==================

* remove: support for node 0.6.x, 0.4.x
* fix: landing reporter with non ansi characters (#211)
* fix: html reporter - preserve query params when navigating to suites/tests (#1358)
* fix: json stream reporter add error message to failed test
* fix: fixes for visionmedia -> mochajs
* fix: use stdio, fixes node deprecation warnings (#1391)

1.21.5 / 2014-10-11
==================

* fix: build for NodeJS v0.6.x
* fix: do not attempt to highlight syntax when non-HTML reporter is used
* update: escape-string-regexp to 1.0.2.
* fix: botched indentation in canonicalize()
* fix: .gitignore: ignore .patch and .diff files
* fix: changed 'Catched' to 'Caught' in uncaught exception error handler messages
* add: `pending` field for json reporter
* fix: Runner.prototype.uncaught: don't double-end runnables that already have a state.
* fix: --recursive, broken by f0facd2e
* update: replaces escapeRegexp with the escape-string-regexp package.
* update: commander to 2.3.0.
* update: diff to 1.0.8.
* fix: ability to disable syntax highlighting (#1329)
* fix: added empty object to errorJSON() call to catch when no error is present
* fix: never time out after calling enableTimeouts(false)
* fix: timeout(0) will work at suite level (#1300)
* Fix for --watch+only() issue (#888 )
* fix: respect err.showDiff, add Base reporter test (#810)

1.22.1-3 / 2014-07-27
==================

* fix: disabling timeouts with this.timeout(0) (#1301)

1.22.1-3 / 2014-07-27
==================

* fix: local uis and reporters (#1288)
* fix: building 1.21.0's changes in the browser (#1284)

1.21.0 / 2014-07-23
==================

* add: --no-timeouts option (#1262, #1268)
* add: --*- deprecation node flags (#1217)
* add: --watch-extensions argument (#1247)
* change: spec reporter is default (#1228)
* fix: diff output showing incorrect +/- (#1182)
* fix: diffs of circular structures (#1179)
* fix: re-render the progress bar when progress has changed only (#1151)
* fix support for environments with global and window (#1159)
* fix: reverting to previously defined onerror handler (#1178)
* fix: stringify non error objects passed to done() (#1270)
* fix: using local ui, reporters (#1267)
* fix: cleaning es6 arrows (#1176)
* fix: don't include attrs in failure tag for xunit (#1244)
* fix: fail tests that return a promise if promise is rejected w/o a reason (#1224)
* fix: showing failed tests in doc reporter (#1117)
* fix: dot reporter dots being off (#1204)
* fix: catch empty throws (#1219)
* fix: honoring timeout for sync operations (#1242)
* update: growl to 1.8.0

1.20.1 / 2014-06-03
==================

Expand Down
38 changes: 31 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

REPORTER ?= dot
REPORTER ?= spec
TM_BUNDLE = JavaScript\ mocha.tmbundle
SRC = $(shell find lib -name "*.js" -type f | sort)
SUPPORT = $(wildcard support/*.js)
Expand All @@ -9,7 +9,10 @@ all: mocha.js
lib/browser/diff.js: node_modules/diff/diff.js
cp node_modules/diff/diff.js lib/browser/diff.js

mocha.js: $(SRC) $(SUPPORT) lib/browser/diff.js
lib/browser/escape-string-regexp.js: node_modules/escape-string-regexp/index.js
cp node_modules/escape-string-regexp/index.js lib/browser/escape-string-regexp.js

mocha.js: $(SRC) $(SUPPORT) lib/browser/diff.js lib/browser/escape-string-regexp.js
@node support/compile $(SRC)
@cat \
support/head.js \
Expand All @@ -20,6 +23,7 @@ mocha.js: $(SRC) $(SUPPORT) lib/browser/diff.js

clean:
rm -f mocha.js
rm -rf test-outputs
rm -fr lib-cov
rm -f coverage.html

Expand All @@ -32,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-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-suppress-stack

test-jsapi:
@node test/jsapi
Expand All @@ -44,8 +48,17 @@ test-unit:
--growl \
test/*.js

test-failing:
test-regression: test-outputs/issue1327/case-out.json
@./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/timeout.js > /dev/null 2>&1 ; \
failures="$$?" ; \
Expand All @@ -58,14 +71,14 @@ test-failing:
test-compilers:
@./bin/mocha \
--reporter $(REPORTER) \
--compilers coffee:coffee-script,foo:./test/compiler/foo \
--compilers coffee:coffee-script/register,foo:./test/compiler/foo \
test/acceptance/test.coffee \
test/acceptance/test.foo

test-requires:
@./bin/mocha \
--reporter $(REPORTER) \
--compilers coffee:coffee-script \
--compilers coffee:coffee-script/register \
--require test/acceptance/require/a.js \
--require test/acceptance/require/b.coffee \
--require test/acceptance/require/c.js \
Expand Down Expand Up @@ -173,7 +186,18 @@ non-tty:
@echo spec:
@cat /tmp/spec.out

test-suppress-stack:
@output=$$(./bin/mocha \
--reporter $(REPORTER) \
--suppress-stack \
test/acceptance/misc/suppressStack 2>&1 > /tmp/stack.out) ; \
if [ $$(echo $$output | grep -Pc "(\s*at\s.*)|%s") -gt 0 ] ; then \
echo 'test-suppress-stack:' ; \
echo " expected error output not to contain a stack trace" ; \
exit 1 ; \
fi

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 non-tty test-grep test-failing test-suppress-stack tm clean
Loading