title: How to run (Python-like) doctests in JavaScript?
body: <p>Do any JavaScript test frameworks provide a rough equivalent to Python's doctest?</p>
  
  <pre><code>function add(a, b) {
    /**
    Returns the sum of `a` and `b`:
  
      &gt; add(1, 3)
      4
  
    Add coerces types to numeric values where possible:
  
      &gt; add('51' + 3)
      54
    */
    return (a - 0) + (b - 0);
  }
  </code></pre>