Skip to content
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

yarn test fails in a new 0.76 app #14112

Open
TatianaKapos opened this issue Nov 14, 2024 · 1 comment
Open

yarn test fails in a new 0.76 app #14112

TatianaKapos opened this issue Nov 14, 2024 · 1 comment
Assignees
Milestone

Comments

@TatianaKapos
Copy link
Contributor

TatianaKapos commented Nov 14, 2024

Problem Description

Found on react-native-xaml CI, running yarn test on a new 0.76 application has a reference error. Test still passes but will break CI

ReferenceError: You are trying to import a file after the Jest environment has been torn down. From __tests__/App.test.tsx.

      at require (node_modules/react-native/Libraries/Utilities/Appearance.js:44:28)
      at getState (node_modules/react-native/Libraries/Utilities/Appearance.js:118:26)
      at subscribe (node_modules/react-native/Libraries/Utilities/useColorScheme.js:19:51)
      at subscribeToStore (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:6232:10)
      at commitHookEffectListMount (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:13038:26)
      at commitPassiveMountOnFiber (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14461:11)
      at commitPassiveMountEffects_complete (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14421:9)
      at commitPassiveMountEffects_begin (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14408:7)
      at commitPassiveMountEffects (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14396:3)
      at flushPassiveEffectsImpl (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16287:3)
      at flushPassiveEffects (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16236:14)
      at node_modules/react-test-renderer/cjs/react-test-renderer.development.js:16051:9
      at workLoop (node_modules/react-test-renderer/node_modules/scheduler/cjs/scheduler.development.js:266:34)
      at flushWork (node_modules/react-test-renderer/node_modules/scheduler/cjs/scheduler.development.js:239:14)
      at Immediate.performWorkUntilDeadline [as _onImmediate] (node_modules/react-test-renderer/node_modules/scheduler/cjs/scheduler.development.js:533:21)
 PASS  __tests__/App.test.tsx (9.484 s)
  √ renders correctly (1892 ms)

Image

Steps To Reproduce

  1. Create a new 0.76 application
  2. Run yarn and yarn test

Expected Results

yarn tests passes without a ReferenceError

CLI version

15.0.0

Environment

info Fetching system and libraries information...
System:
  OS: Windows 11 10.0.26100
  CPU: (8) x64 Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz
  Memory: 35.57 GB / 63.85 GB
Binaries:
  Node:
    version: 18.18.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.5
    path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
  npm:
    version: 8.18.0
    path: ~\AppData\Roaming\npm\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    AllowAllTrustedApps: Enabled
    Versions:
      - 10.0.17763.0
      - 10.0.18362.0
      - 10.0.19041.0
      - 10.0.22000.0
      - 10.0.22621.0
IDEs:
  Android Studio: AI-213.7172.25.2113.9014738
  Visual Studio:
    - 16.11.35325.158 (Visual Studio Enterprise 2019)
    - 17.11.35327.3 (Visual Studio Enterprise 2022)
Languages:
  Java:
    version: 11.0.16.1
    path: C:\Program Files\Eclipse Adoptium\jdk-11.0.16.101-hotspot\bin\javac.EXE
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.0
    wanted: 15.0.0
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.1
    wanted: 0.76.1
  react-native-windows:
    installed: 0.76.0
    wanted: 0.76.0
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Community Modules

No response

Target Platform Version

10.0.22621

Target Device(s)

Desktop

Visual Studio Version

Visual Studio 2022

Build Configuration

Debug

Snack, code example, screenshot, or link to a repository

No response

@TatianaKapos TatianaKapos changed the title yarn tests fails in a new 0.76 app yarn test fails in a new 0.76 app Nov 14, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Nov 14, 2024
@chrisglein
Copy link
Member

Test actually succeeds with this error.
Check to see if there's an upstream issues for this, as this failure isn't in the Windows part of the test flow.
Question raised as to whether yarn test:windows has different results. That'll help inform where the failure is.

@chrisglein chrisglein added this to the 0.76 milestone Nov 14, 2024
@chrisglein chrisglein added Area: Tests and removed Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) labels Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants