Skip to content

Don't ignore Stdlib_* files when generating docstring tests #7694

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

Merged
merged 3 commits into from
Jul 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

- Add rust linting to CI with `clippy`. https://github.com/rescript-lang/rescript/pull/7675
- AST: use `Typ.arrows` for creation, after the refactoring of arrow types. https://github.com/rescript-lang/rescript/pull/7662
- Don't skip Stdlib docstring tests. https://github.com/rescript-lang/rescript/pull/7694

#### :bug: Bug fix

Expand Down
28 changes: 12 additions & 16 deletions tests/docstring_tests/DocTest.res
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ let nodeVersion =

let ignoreRuntimeTests = [
(
// Ignore some tests require Node.js v20+
// Ignore tests that require Node.js v20+
Copy link
Collaborator

@nojaf nojaf Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we still need this?
Our .nvm is 22 now right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to get rid of if we can.

20,
["Stdlib.Array.toReversed", "Stdlib.Array.toSorted"],
["Stdlib_Array.toReversed", "Stdlib_Array.toSorted"],
),
(
// Ignore some tests require Node.js v22+
// Ignore tests that require Node.js v22+
22,
[
"Stdlib.Promise.withResolvers",
"Stdlib.Set.union",
"Stdlib.Set.isSupersetOf",
"Stdlib.Set.isSubsetOf",
"Stdlib.Set.isDisjointFrom",
"Stdlib.Set.intersection",
"Stdlib.Set.symmetricDifference",
"Stdlib.Set.difference",
"Stdlib_Promise.withResolvers",
"Stdlib_Set.union",
"Stdlib_Set.isSupersetOf",
"Stdlib_Set.isSubsetOf",
"Stdlib_Set.isDisjointFrom",
"Stdlib_Set.intersection",
"Stdlib_Set.symmetricDifference",
"Stdlib_Set.difference",
],
),
]
Expand Down Expand Up @@ -65,11 +65,7 @@ let extractExamples = async () => {
let docFiles = files->Array.filter(f =>
switch f {
// Ignore Js modules and RescriptTools for now
// Avoid Stdlib modules showing up as both "Stdlib_X" and "Stdlib.X"
| f
if f->String.startsWith("Js") ||
f->String.startsWith("RescriptTools") ||
f->String.startsWith("Stdlib_") => false
| f if f->String.startsWith("Js") || f->String.startsWith("RescriptTools") => false
| f if f->String.endsWith(".resi") => true
| f if f->String.endsWith(".res") && !(files->Array.includes(f ++ "i")) => true
| _ => false
Expand Down
22 changes: 11 additions & 11 deletions tests/docstring_tests/DocTest.res.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.