@samitouri / QOS-React / commits / 4b53dd0e6b

Disable ESLint's no-extend-native for two lines (#9625)

Paul Manta committed May 21, 2017 at 01:58 UTC 4b53dd0e6b892b6de6f991d168b1ebe5f99068b5
1 file changed +3 -2
src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
+3 -2
@@ -816,16 +816,17 @@ describe('ReactDOMComponent', () => {
816 let realToString;
817 try {
818 realToString = Object.prototype.toString;
819 - Object.prototype.toString = function() {
819 + let wrappedToString = function() {
820 // Emulate browser behavior which is missing in jsdom
821 if (this instanceof window.HTMLUnknownElement) {
822 return '[object HTMLUnknownElement]';
823 }
824 return realToString.apply(this, arguments);
825 };
826 + Object.prototype.toString = wrappedToString; // eslint-disable-line no-extend-native
827 ReactTestUtils.renderIntoDocument(<mycustomcomponent />);
828 } finally {
828 - Object.prototype.toString = realToString;
829 + Object.prototype.toString = realToString; // eslint-disable-line no-extend-native
830 }
831
832 expectDev(console.error.calls.count()).toBe(1);