duskload / react-device-detect

Detect device, and render view according to detected device type.
MIT License
2.82k stars 155 forks source link

TypeScript error on tests #195

Open jonathanpauluze opened 2 years ago

jonathanpauluze commented 2 years ago
  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
  3. --
  4. --
  5. 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... })


6. --