-
Notifications
You must be signed in to change notification settings - Fork 456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run docstrings tests with mocha #7220
run docstrings tests with mocha #7220
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! This is awesome. Huge speedup (> 10x on my machine).
Some feedback:
generated_mocha.test.res
is quite huge. Maybe we shouldn't check it in?- If possible, could we change the generation so that we get one
describe
call per module (e.g.,String
) with multipletest
calls inside (one per function, e.g.,charAt
,charCodeAt
, ...). - Is the inner
module Test
actually needed? In what cases?
| None => [] | ||
} | ||
// Ignore some tests not supported by node v18 | ||
let ignoreRuntimeTests = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bonus points: detect node version and run tests accordingly. As these tests actually work with Node 22.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
let main = async () => { | ||
let examples = await extractExamples() | ||
examples->Array.sort((a, b) => | ||
Obj.magic(a.id) > Obj.magic(b.id) ? Ordering.fromInt(1) : Ordering.fromInt(-1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need Obj.magic
here?
I think this can just be
examples->Array.sort((a, b) => String.compare(a.id, b.id))
and should be moved into the extractExamples
function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
|
Doesn't really seem to be done yet? I still see one But never mind, we can always improve things in separate PRs. |
Sorry, please disregard, seems I somehow had a stale generated file locally. 🤦 |
Main changes:
generated_mocha_test.res
mocha