Skip to content

Commit

Permalink
Fix linting warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nhunzaker committed Nov 19, 2016
1 parent 0c7e145 commit 2a690d0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 42 deletions.
3 changes: 1 addition & 2 deletions docs/docs/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ The React add-ons are a collection of useful utility modules for building React
The add-ons below are in the development (unminified) version of React only:

- [`Perf`](perf.html), a performance profiling tool for finding optimization opportunities.
- [`ReactTestUtils`](test-utils.html), simple helpers for writing test
cases.
- [`ReactTestUtils`](test-utils.html), simple helpers for writing test cases.

### Legacy Add-ons

Expand Down
39 changes: 0 additions & 39 deletions src/addons/__tests__/ReactDOMFactories-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

'use strict';

var React = require('React');
var ReactDOM = require('ReactDOM');
var ReactTestUtils = require('ReactTestUtils');
var {div} = require('ReactDOMFactories');

describe('ReactDOMFactories', () => {
Expand All @@ -25,40 +22,4 @@ describe('ReactDOMFactories', () => {
expectDev(console.error.calls.count()).toBe(0);
});

it('identifies valid elements', () => {
var Component = React.createClass({
render: function() {
return React.createElement('div');
},
});
expect(React.isValidElement(div)).toEqual(false);
});

it('identifies elements, but not JSON, if Symbols are supported', () => {
// Rudimentary polyfill
// Once all jest engines support Symbols natively we can swap this to test
// WITH native Symbols by default.
var REACT_ELEMENT_TYPE = function() {}; // fake Symbol
var OTHER_SYMBOL = function() {}; // another fake Symbol
global.Symbol = function(name) {
return OTHER_SYMBOL;
};
global.Symbol.for = function(key) {
if (key === 'react.element') {
return REACT_ELEMENT_TYPE;
}
return OTHER_SYMBOL;
};

jest.resetModuleRegistry();

React = require('React');

var Component = React.createClass({
render: function() {
return React.createElement('div');
},
});
expect(React.isValidElement(div)).toEqual(false);
});
});
10 changes: 9 additions & 1 deletion src/isomorphic/classic/element/__tests__/ReactElement-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ describe('ReactElement', () => {
expect(React.isValidElement(true)).toEqual(false);
expect(React.isValidElement({})).toEqual(false);
expect(React.isValidElement('string')).toEqual(false);
expect(React.isValidElement(React.createFactory('div'))).toEqual(false);
expect(React.isValidElement(Component)).toEqual(false);
expect(React.isValidElement({ type: 'div', props: {} })).toEqual(false);

Expand Down Expand Up @@ -516,6 +517,7 @@ describe('ReactElement', () => {
expect(React.isValidElement(true)).toEqual(false);
expect(React.isValidElement({})).toEqual(false);
expect(React.isValidElement('string')).toEqual(false);
expect(React.isValidElement(React.createFactory('div'))).toEqual(false);
expect(React.isValidElement(Component)).toEqual(false);
expect(React.isValidElement({ type: 'div', props: {} })).toEqual(false);

Expand Down Expand Up @@ -598,7 +600,13 @@ describe('comparing jsx vs .createFactory() vs .createElement()', () => {
beforeEach(() => {
var Parent = React.createClass({
render: function() {
return React.createElement('div', {}, React.createElement(Child, { ref: 'child', foo: 'foo value' }, 'children value'));
return (
React.createElement('div', null,
React.createElement(Child, {
ref: 'child',
foo: 'foo value',
}, 'children value'))
);
},
});
factory = React.createFactory(Parent);
Expand Down

0 comments on commit 2a690d0

Please sign in to comment.