rescript-core
rescript-core copied to clipboard
Runtime tests using examples from docstrings
This PR is a proposal to add unit tests using docstrings. Currently the examples from docstrings have tests for compilation only.
bscemits the Js and passes the code tonodeusing the--eval|-eargument.
TODO:
- [x] Fix examples
- [x] Remove examples with infinite loop,
setIntervalFloat - [x] Update CHANGELOG
Changes
- Added
assert_eqfunction - Runtime errors captured
- Removed some examples with infinite loop at
src/Core__Global.resi - Removed
Arrayfrom the test suite and moved it to docstrings.
DocTest script
- Added argument
--ignore-runtime-tests--ignore-runtime-tests 'RescriptCore.Array.toReversed,RescriptCore.Promise.withResolvers'.Array.toReversedandPromise.withResolversare not supported by Node
Ready for review
I made a small improvement in two examples in the Null and Nullable module
@zth what do you think?