Skip to content

Commit b63b544

Browse files
authored
Don't ignore Stdlib_* files when generating docstring tests (#7694)
* Don't ignore Stdlib_* files when generating doc tests * Use correct test IDs when ignoring doc tests due to node.js version * Add CHANGELOG entry
1 parent 76d783e commit b63b544

File tree

3 files changed

+24
-27
lines changed

3 files changed

+24
-27
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

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

3233
#### :bug: Bug fix
3334

tests/docstring_tests/DocTest.res

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ let nodeVersion =
1212

1313
let ignoreRuntimeTests = [
1414
(
15-
// Ignore some tests require Node.js v20+
15+
// Ignore tests that require Node.js v20+
1616
20,
17-
["Stdlib.Array.toReversed", "Stdlib.Array.toSorted"],
17+
["Stdlib_Array.toReversed", "Stdlib_Array.toSorted"],
1818
),
1919
(
20-
// Ignore some tests require Node.js v22+
20+
// Ignore tests that require Node.js v22+
2121
22,
2222
[
23-
"Stdlib.Promise.withResolvers",
24-
"Stdlib.Set.union",
25-
"Stdlib.Set.isSupersetOf",
26-
"Stdlib.Set.isSubsetOf",
27-
"Stdlib.Set.isDisjointFrom",
28-
"Stdlib.Set.intersection",
29-
"Stdlib.Set.symmetricDifference",
30-
"Stdlib.Set.difference",
23+
"Stdlib_Promise.withResolvers",
24+
"Stdlib_Set.union",
25+
"Stdlib_Set.isSupersetOf",
26+
"Stdlib_Set.isSubsetOf",
27+
"Stdlib_Set.isDisjointFrom",
28+
"Stdlib_Set.intersection",
29+
"Stdlib_Set.symmetricDifference",
30+
"Stdlib_Set.difference",
3131
],
3232
),
3333
]
@@ -65,11 +65,7 @@ let extractExamples = async () => {
6565
let docFiles = files->Array.filter(f =>
6666
switch f {
6767
// Ignore Js modules and RescriptTools for now
68-
// Avoid Stdlib modules showing up as both "Stdlib_X" and "Stdlib.X"
69-
| f
70-
if f->String.startsWith("Js") ||
71-
f->String.startsWith("RescriptTools") ||
72-
f->String.startsWith("Stdlib_") => false
68+
| f if f->String.startsWith("Js") || f->String.startsWith("RescriptTools") => false
7369
| f if f->String.endsWith(".resi") => true
7470
| f if f->String.endsWith(".res") && !(files->Array.includes(f ++ "i")) => true
7571
| _ => false

tests/docstring_tests/DocTest.res.js

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)