Repository navigation
Add .each to Fantom's describe, it and test - #60586
Open
YevheniiKotyrlo wants to merge 1 commit into
Open
YevheniiKotyrlo wants to merge 1 commit into
YevheniiKotyrlo wants to merge 1 commit into
Conversation
Fantom's runtime installed `describe`, `it` and `test` without the `.each` forms that the Flow Jest libdef declares, so a table test passed Flow and threw when it ran. Each declaration and its `only` and `skip` forms now get an `each` in jest-each's forms: array tables with printf placeholders, object tables with `$key` titles, and tagged template tables; an `it.each` or `test.each` table it cannot read declares one failing test that says why, and a `describe.each` one fails the file. The libdef gives `describe.only`, `describe.skip` and `fit` an `each`, as Jest's own types do. Signed-off-by: YevheniiKotyrlo <44449990+YevheniiKotyrlo@users.noreply.github.com>
YevheniiKotyrlo
force-pushed
the
fix/fantom-test-each
branch
from
December 5, 2026 01:12
dc8d8a1 to
4fc76ec
Compare
YevheniiKotyrlo
marked this pull request as ready for review
December 5, 2026 02:09
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Fantom's runtime defines
describe,itandtestwithout their.eachforms, whileflow-typed/environment/jest.js, which Fantom tests are checked against, declareseachon all three. A table test therefore passes Flow and then fails its whole suite when Fantom runs it:This adds
runtime/each.js, which givesdescribe,it,testand theironlyandskipforms aneach(sofdescribe,xdescribe,fit,xitandxtesthave one too), following jest-each:%p,%s,%d,%i,%f,%j,%o,%O,%#,%$and%%;$key,$key.pathand$#;describe.eachthat fails the file, as a throwingdescribedoes.jest-each formats titles with Node's
util.formatandutil.inspect, which a Hermes bundle cannot load, so a value under%oor%O, and an object under%swhosetoStringis a built-in one, print withpretty-format, as%pprints them; a%cor a second%#stays in the title as written, and the messages carry no colours. A placeholder inside a printed value also stays as written, where jest-each fills it with the next value (jestjs/jest#16559 proposes the same for jest-each); a template whose headings are not a string fails withTable headings do not conform to expected format; and a function as the title fails the table, since Fantom'sdescribeandittake a string.The libdef gives
describe.only,describe.skipandfitaneach, as Jest's own types do.Fixes #60563.
Changelog:
[INTERNAL] [ADDED] - Fantom:
describe.each,it.eachandtest.each, with theironlyandskipformsTest Plan:
I ran these CI jobs with their workflows' steps in a Linux container on Node 22.14.0 (
test-all.ymlrunstest_json Node 24 and 22.13.0):lint(ESLint, Flow, the legacy TypeScript check) andtest_jspass; Jest givesTest Suites: 303 passed, 303 total,Tests: 1 skipped, 6968 passed, 6969 total, the.eachcases being inprivate/react-native-fantom/runtime/__tests__/setup-test.js.run_fantom_tests(yarn fantom --ci):Test Suites: 26 skipped, 209 passed, 209 of 235 total,Tests: 73 skipped, 4330 passed, 4403 total. The newprivate/react-native-fantom/src/__tests__/setup/each-itest.jsis among them, checking on Hermes the rows, an object'stoStringunder%sand the first frame of a table it cannot read; itstest.each,it.eachanddescribe.eachtables, run onmain, fail the suite withTypeError: undefined is not a function.build_js_typespasses, and so doesformat.yml's check for every formatter butswift, which needs a Swift 6.3 toolchain the container lacks.I did not run
test_android,test_iosortest_react_common_cxx, whichtest-all.ymlstarts for this change.