yamadapc / jsdoctest

Run jsdoc examples as doctests.
https://yamadapc.github.io/jsdoctest
MIT License
92 stars 9 forks source link

Allow tests in class/constructor/property docs #36

Closed benkuhn closed 3 years ago

benkuhn commented 5 years ago

Currently the following doctests are all silently ignored, which is surprising behavior:

/**
 * @example
 * 1 // => 2
 */
class Foo {
  /**
   * @example
   * 1 // => 2
   */
  constructor()
  /**
   * @example
   * 1 // => 2
   */
  get bar() {
  }
}

This patch fixes that.

I tested this locally on the (private) repo where I noticed the problem. Let me know how you'd like additional tests to be added if needed. Also there might be further contexts that should be checked here; I haven't written much JS in a while so not sure.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 76.963% when pulling 0dd89bf1441f94a36164d5b9e993ee0587a81728 on benkuhn:patch-1 into ccd6cdbff8a4db98d20da8ac1868558a45913005 on yamadapc:master.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 76.963% when pulling 0dd89bf1441f94a36164d5b9e993ee0587a81728 on benkuhn:patch-1 into ccd6cdbff8a4db98d20da8ac1868558a45913005 on yamadapc:master.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 76.963% when pulling 0dd89bf1441f94a36164d5b9e993ee0587a81728 on benkuhn:patch-1 into ccd6cdbff8a4db98d20da8ac1868558a45913005 on yamadapc:master.

yamadapc commented 3 years ago

Makes sense. Thanks!