Fantom's screenshotUtils-test.js fails on Windows: a test expects `/` in a path built with path.join
Mantenedores costumam responder em até 2 dias
Avaliação
- Dificuldade
- 1/5
- Tempo estimado
- Menos de uma hora
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Estagnada
- Stack de tecnologia
- javascript, node.js, react-native
Direção de pesquisa
Read private/react-native-fantom/runner/screenshots/__tests__/screenshotUtils-test.js, especially the “creates new images next to Jest snapshots” test around lines 184–189. Run the reported Jest command on Windows to confirm the path separator failure; compare its assertion with the earlier path.join assertion. Done when the test passes on Windows and still checks that the image path is beside the test file. An open linked pull request is already addressing this issue.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Description
private/react-native-fantom/runner/screenshots/__tests__/screenshotUtils-test.js's test "creates new images next to Jest snapshots" checks result.expectedPath with toContain('__snapshots__/example-test.js.screenshots/') (L184-L189). That path is built with path.join, which joins with \ on Windows, so the test fails there. The test before it compares with path.join(directory, 'actual.diff.png') (L170-L172). The assertion came with https://github.com/react/react-native/pull/59483.
Steps to reproduce
- On Windows, in a checkout of
main(7a5d4ded60b) afteryarn install, runyarn jest private/react-native-fantom/runner/screenshots/__tests__/screenshotUtils-test.js -t "creates new images next to Jest snapshots"; or runnode repro.cjs <path to the checkout>from the reproducer below, which runs that one test and exits 1 while it fails.
Expected: the test passes on Windows, still checking that the new image is written under __snapshots__/example-test.js.screenshots/ beside the test file.
Actual: expect(received).toContain(expected) fails: the received path is C:\\Users\\…\\AppData\\Local\\Temp\\fantom-screenshot-test-VBIJPX\\__snapshots__\\example-test.js.screenshots\\image.png.
React Native Version
main at 7a5d4ded60b (nightly)
Affected Platforms
Build - Windows
Output of npx @react-native-community/cli info
Not applicable: this is a test in React Native's own repository. The reproducer's run:
react-native 7a5d4ded60b (2026-11-16), Windows_NT 10.0.26300, node v26.12.1, path.sep "\\"
Stacktrace or Logs
react-native 7a5d4ded60b (2026-11-16), Windows_NT 10.0.26300, node v26.12.1, path.sep "\\"
test file: private/react-native-fantom/runner/screenshots/__tests__/screenshotUtils-test.js
$ yarn jest private/react-native-fantom/runner/screenshots/__tests__/screenshotUtils-test.js -t "creates new images next to Jest snapshots"
jest exited 1
"creates new images next to Jest snapshots": failed
Error: expect(received).toContain(expected) // indexOf
Expected substring: "__snapshots__/example-test.js.screenshots/"
Received string: "C:\\Users\\…\\AppData\\Local\\Temp\\fantom-screenshot-test-VBIJPX\\__snapshots__\\example-test.js.screenshots\\image.png"
at Object.toContain (private\react-native-fantom\runner\screenshots\__tests__\screenshotUtils-test.js:187:31)
SUMMARY: "creates new images next to Jest snapshots" fails on Windows: expectedPath, built with path.join, is C:\Users\…\AppData\Local\Temp\fantom-screenshot-test-VBIJPX\__snapshots__\example-test.js.screenshots\image.png, which does not contain "__snapshots__/example-test.js.screenshots/"
MANDATORY Reproducer
https://gist.github.com/YevheniiKotyrlo/38bf06d3101dd5ee6f3208fd5afc7824 — node repro.cjs <path to a react-native checkout> exits 1 while the test fails and 0 once it passes.
Screenshots and Videos
No response
- Linguagem predominante
- C++
- Estrelas
- 127k
- Forks
- 25.5k
- Merge médio
- 3d 22h
- PRs com merge (30d)
- 235
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de react/react-native
-
Needs: Author Feedback Needs: Repro
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
react/react-native#60059 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
Needs: Triage :mag:
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
react/react-native#60000 ·
Mantenedores costumam responder em até 2 dias
-
`yarn test-ios` exits before building RNTester: `objc-test.sh` launches the WebSocket server script #59433 deletedTalvez já em andamento @lazerg assumiu há 4 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
react/react-native#59939 ·
Mantenedores costumam responder em até 2 dias
-
iOS Fabric pointer-handler reset leaves the next lone touch non-primaryTalvez já em andamento @alleneubank assumiu há 6 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
react/react-native#59919 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
react/react-native#59722 ·
Mantenedores costumam responder em até 2 dias
Todas as issues de react/react-native
Issues semelhantes
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
petercorke/robotics-toolbox-python#943 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
area:build bug
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
NatronGitHub/openfx-arena#71 ·
Mantenedores costumam responder em até 1 dia
-
upstream-watcher: Netflix/vmaf cf677baaa039 is not portedTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertaupstream-blocked
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
ROCm/FastFlowLM#1057 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
NatronGitHub/openfx-gmic#45 ·
Mantenedores costumam responder em até 1 dia