tape-testing / tape

tap-producing test harness for node and browsers
MIT License
5.77k stars 307 forks source link

[readme] improve `t.throws`/`t.doesNotThrow` documentation #541

Closed cagross closed 3 years ago

cagross commented 3 years ago

Hi Jordan,

Sorry for the delay on this. Per our discussion (in issue #540), in this commit I have edited the README to describe the following:

Have a look and let me know if anything is incomplete or inaccurate.

For now, due to time constraints, I omitted an example of validation object usage, and simply added a link to the Node documentation. I'd very much like to add such an example (as they've done on the Node documentation page), but I'm out of time today, and might get busy with work tomorrow for the next week or so. I can try to keep you posted here on that schedule. But it may be the case where you want to merge these edits now, and I open a new pull request next week which adds the validation object example.

Two more questions that we might want to address now (or earmark for future discussion):

  1. Are there files other than the README that should be updated with this information? If so, I can do that if you want (either in this pull request or a separate pull request in the future).

  2. In the README, should other methods be updated with similar information? i.e. are there other methods with an expected parameter that cannot be a string? If so, I can do that if you want (either in this pull request or a separate pull request in the future).

--Carl

codecov-io commented 3 years ago

Codecov Report

Merging #541 (84fcf48) into master (3b924b0) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #541   +/-   ##
=======================================
  Coverage   74.15%   74.15%           
=======================================
  Files          19       19           
  Lines         766      766           
  Branches      146      146           
=======================================
  Hits          568      568           
  Misses        198      198           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3b924b0...84fcf48. Read the comment docs.

cagross commented 3 years ago

Mind making the same changes to doesNotThrow, just below?

OK sure. Give me 24 hours and I'll push a new commit to this PR.

(There aren't any other files to update; and other than throws/doesNotThrow, let's save additional updates for another PR)

OK noted on all.

cagross commented 3 years ago

OK I just pushed a second commit with the edits to t.doesNotThrow(). I omitted the validation object as an allowed value for expected, since Node's doesNotThrow does not allow it as a parameter. I hope that was correct. If not let me know and I can add it back in.

I also added some of the existing verbiage from t.doesNotThrow() to t.throws() because it looked helpful (specifically the regex usage example). Let me know if I did so incorrectly.

cagross commented 3 years ago

Great! Give me a few more days and I'll add that validation object example we discussed.

If new issues are submitted related to this area, feel free to tag me (or this PR, or my commits, or whatever), and I can take a look.