paralleldrive / paralleldrive/riteway

Missing documentation for Try utility in README

Open
#398 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.2k
Forks
40
Avg merge
4h 53m
Merged PRs (30d)
7

Description

The README imports and uses the Try function in the example code:
README.md

Lines 75-75
import { describe, Try } from 'riteway/index.js';

Lines 110-112
actual: Try(sum, 1, NaN),expected: new TypeError('NaN')

However, there's no documentation section explaining:
What the Try function does
When to use it (appears to be for testing exceptions/throws)
Its API signature and parameters
How it compares the actual error to the expected error
The README has thorough API documentation for describe, assert, render, match, and countKeys, but Try is missing from the API section despite being a core utility for testing error cases.
Suggested Fix:
Add a section to the API documentation (after the countKeys section) that describes:

TryGiven a function and arguments, return the error thrown or undefined if no error was thrown. Used for testing exception cases in your assertions.

This would help developers understand how to properly test error-throwing functions with Riteway.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read README.md, especially the Try usage around lines 75 and 110-112 and the API section after countKeys. Document Try's purpose, signature, parameters, returned error behavior, and how it compares actual and expected errors. Done means the README explains when and how to use Try for testing thrown exceptions.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.