Im trying to change the navigator userAgent through jest and for different agent we have different code to be executed.It seems not possible to override.Even in the browser im not able to overrride
Object.defineProperty(window.navigator, 'userAgent', { value: 'xxx', writable:true, configurable: true });
VM517:1 Uncaught TypeError: Cannot redefine property: userAgent
at Function.defineProperty (<anonymous>)
at <anonymous>:1:8