-
Notifications
You must be signed in to change notification settings - Fork 36
Open
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels