This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// When getting error: "Cannot read property 'componentWillUnmount' of null" | |
// It's because React is swallowing the exception without rethrowing it | |
// In ReactCompositeComponent.js, edit lines that look like this, and add the Catch part | |
if (canInstantiate) { | |
if (process.env.NODE_ENV !== 'production') { | |
ReactCurrentOwner.current = this; | |
try { | |
inst = new Component(publicProps, publicContext, ReactUpdateQueue); | |
} catch (ex) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let Tools; | |
let getMock; | |
describe('Tools', () => { | |
beforeEach(() => { | |
Tools = proxyquire('../Tools', { | |
'../../../utils/api/requests': { get: getMock }, | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { expect } from 'chai'; | |
const proxyquire = require('proxyquire').noCallThru(); | |
const requestsMock = { get: null }; | |
const Tools = proxyquire('../Tools', { | |
'../../../utils/api/requests': requestsMock, | |
}); | |
describe('Tools', () => { |