Skip to content

Commit

Permalink
Tweak test to avoid awkward eslint warning
Browse files Browse the repository at this point in the history
  • Loading branch information
nhunzaker committed Nov 22, 2016
1 parent c93cdf2 commit 618ed03
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
17 changes: 8 additions & 9 deletions src/addons/__tests__/ReactDOMFactories-test.js
Expand Up @@ -11,14 +11,10 @@

'use strict';

describe('ReactDOMFactories', () => {
var React;
var {div} = require('ReactDOMFactories');

beforeEach(function () {
React = require('React');
})
var React = require('React');
var {div} = require('ReactDOMFactories');

describe('ReactDOMFactories', () => {
it('allow factories to be called without warnings', () => {
spyOn(console, 'error');
var element = div();
Expand All @@ -29,8 +25,11 @@ describe('ReactDOMFactories', () => {
it('warns once when accessing React.DOM methods', () => {
spyOn(console, 'error');

React.DOM.div;
React.DOM.p;
var a = React.DOM.a();
var p = React.DOM.p();

expect(a.type).toBe('a');
expect(p.type).toBe('p');

expectDev(console.error.calls.count()).toBe(1);
});
Expand Down
2 changes: 1 addition & 1 deletion src/isomorphic/React.js
Expand Up @@ -98,7 +98,7 @@ if (__DEV__) {
var hasWarnedOfFactories = false;

React.DOM = new Proxy(React.DOM, {
get: function (target, name) {
get: function(target, name) {
if (!hasWarnedOfFactories) {
warning(
false,
Expand Down

0 comments on commit 618ed03

Please sign in to comment.