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

Exceptions outside tests are silent when using --delay flag #1669

Closed
BrennanRoberts opened this issue Apr 24, 2015 · 2 comments · Fixed by gluckgames/pixi-packer#17
Closed
Assignees
Labels
type: bug a defect, confirmed by a maintainer

Comments

@BrennanRoberts
Copy link

Here's a sample.

When using the "--delay" flag, exceptions outside of a test are silent. For context, I'm using delay in order to load my test files with requirejs, which the timeout is meant to simulate.

When running without --delay (and removing the timeout), the exception is not silent, so I'm assuming this is unintentional.

@boneskull
Copy link
Member

@BrennanRoberts nice catch. any ideas about the best way to solve this? since --delay is not available in a browser context I imagine it's probably safe to play with domains here.

@boneskull boneskull added the type: bug a defect, confirmed by a maintainer label Apr 26, 2015
@boneskull boneskull self-assigned this May 12, 2015
@danielstjules
Copy link
Contributor

Good catch! Found a simpler reproduce case:

setTimeout(function() {
  throw new Error('oops');
  it('test', function() {});
  run();
}, 100);

dasilvacontin added a commit that referenced this issue Sep 13, 2015
Fix #1669: catch uncaught errors outside test suite execution
kevinawoo added a commit to kevinawoo/mocha that referenced this issue Oct 6, 2015
* master: (25 commits)
  Fix mochajs#1798: Correctly attribute mutiple done err with hooks
  Remove redundant harmony flag
  Cast non-string return values from err.inspect()
  Call the inspect() function if message is not set
  Revert jade to support npm < v1.3.7
  Fix eqeqeq linting errors from eslint 1.4.0 release
  Fix mochajs#1669: catch uncaught errors outside test suite execution
  Support all harmony flags
  Fix fragile xunit reporter spec
  Fix linter warning "Expected a conditional expression and instead saw an assignment"
  Stackfilter fix: Don't remove modules/components from stack trace in the browser
  Fix mochajs#1864: xunit missing output with --reporter-options output
  Fix 1875: Markdown reporter exceeds maximum call stack size
  IE<=8 no [].reduce, so use 'utils.reduce' instead
  Release v2.3.2
  remove lodash.create; closes mochajs#1868
  update package.json & component.json for v2.3.1
  update HISTORY.md
  fix package.json to use exact version of lodash; closes mochajs#1867
  Fix: Bail flag causes before() hooks to be run even after a failure
  ...

# Conflicts:
#	lib/runnable.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug a defect, confirmed by a maintainer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants