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

Fix a small typo in the doc reporter that causes mocha to crash #2307

Merged
merged 1 commit into from Jun 17, 2016

Conversation

jleyba
Copy link
Contributor

@jleyba jleyba commented Jun 12, 2016

This fixes the following scenario:

describe('Mocha', function() {
  it('should fail', function() {
    throw Error('ouch');
  });
});
$ mocha example.js --reporter doc
    <section class="suite">
      <h1>Mocha</h1>
      <dl>
        <dt class="error">should fail</dt>
        <dt class="error">should fail</dt>

Expected output:

<section class="suite">
      <h1>Mocha</h1>
      <dl>
        <dt class="error">should fail</dt>
        <dd class="error"><pre><code>throw Error('ouch');</code></pre></dd>
        <dd class="error">Error: ouch</dd>
      </dl>
    </section>

The typo was introduced in d59cc6c:
https://github.com/danielstjules/mocha/blob/d59cc6c166d0d112a62016909b33e04ed08d2274/lib/reporters/doc.js#L58

@boneskull
Copy link
Member

@jleyba this looks good, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants