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

TypeScript error on tests #195

Open
jonathanpauluze opened this issue Oct 22, 2022 · 0 comments
Open

TypeScript error on tests #195

jonathanpauluze opened this issue Oct 22, 2022 · 0 comments

Comments

@jonathanpauluze
Copy link

  1. I'm trying to create a test following the documentation, but TypeScript shows me an error saying that I can't assign values to a read-only property
  2. Steps to reproduce:
  • Create a test file (.spec.tsx)
  • Write an assertion trying to update any rdd variable
  1. --
  2. --
  3. Code:
// Component.spec.tsx
import * as rdd from 'react-device-detect'

it('Should render correctly', () => {
   rdd.isSafari = true // Cannot assign to 'isSafari' because it is a read-only property

  // test here...
})
  1. --
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant