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

Default --preset=expo workspace .toHaveTextContent in App.spec.tsx contains a TypeScript error #23027

Open
1 of 4 tasks
danharten-sovtech opened this issue Apr 26, 2024 · 0 comments
Assignees
Labels
scope: react-native Issues relating to React Native type: bug

Comments

@danharten-sovtech
Copy link

Current Behavior

Currently, .toHaveTextContent greets the developer with: Property 'toHaveTextContent' does not exist on type 'JestMatchers<ReactTestInstance>'.

Expected Behavior

No TypeScript error.

To fix this, update tsconfig.spec.json types to include the appropriate types, like so: "types": ["jest", "node", "@testing-library/jest-native"]

This way, the expo preset can be presented error free.

GitHub Repo

No response

Steps to Reproduce

  1. run npx create-nx-workspace@latest --preset=expo --appName=your-app-name
  2. Navigate to app/App.spec.tsx
  3. See typescript error

Nx Report

Node   : 20.9.0
OS     : darwin-arm64
npm    : 10.1.0

nx (global)        : 18.3.2
nx                 : 18.3.4
@nx/js             : 18.3.4
@nx/jest           : 18.3.4
@nx/linter         : 18.3.4
@nx/eslint         : 18.3.4
@nx/workspace      : 18.3.4
@nx/detox          : 18.3.4
@nx/devkit         : 18.3.4
@nx/eslint-plugin  : 18.3.4
@nx/expo           : 18.3.4
@nx/react          : 18.3.4
@nrwl/tao          : 18.3.4
@nx/web            : 18.3.4
@nx/webpack        : 18.3.4
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
@nx/expo/plugin
@nx/eslint/plugin
@nx/jest/plugin
@nx/detox/plugin

Failure Logs

No response

Package Manager Version

1.22.19

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@AgentEnder AgentEnder added the scope: react-native Issues relating to React Native label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: react-native Issues relating to React Native type: bug
Projects
None yet
Development

No branches or pull requests

3 participants