How do you mock global.navigator.onLine in jest for React.
My version of jest is the latest 24.9.0
I've tried
global.navigator = {
onLine: false,
}
and using jest.fn().mockImplementation(() => ({onLine: false}))
They still seem to return true for navigator.onLine