Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ReactWrapper and ShallowWrapper iterable #594

Merged
merged 5 commits into from
Oct 11, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Only test iterable when Symbol.iterator exists
  • Loading branch information
Brandon Dail authored and Brandon Dail committed Oct 11, 2016
commit 5b9022a295f3bc3e52c426e65ec771b24da4d354
3 changes: 2 additions & 1 deletion test/ReactWrapper-spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
render,
ReactWrapper,
} from '../src';
import { ITERATOR_SYMBOL } from '../src/Utils';
import { REACT013, REACT014, REACT15 } from '../src/version';

describeWithDOM('mount', () => {
Expand Down Expand Up @@ -3025,7 +3026,7 @@ describeWithDOM('mount', () => {
});
});

describe('@@iterator', () => {
describeIf(ITERATOR_SYMBOL, '@@iterator', () => {
it('should be iterable', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these tests should be skipped when the environment lacks Symbols.

class Foo extends React.Component {
render() {
Expand Down
3 changes: 2 additions & 1 deletion test/ShallowWrapper-spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import sinon from 'sinon';

import { shallow, render, ShallowWrapper } from '../src/';
import { describeIf, itIf, itWithData, generateEmptyRenderData } from './_helpers';
import { ITERATOR_SYMBOL } from '../src/Utils';
import { REACT013, REACT15 } from '../src/version';

describe('shallow', () => {
Expand Down Expand Up @@ -3627,7 +3628,7 @@ describe('shallow', () => {
});
});

describe('@@iterator', () => {
describeIf(ITERATOR_SYMBOL, '@@iterator', () => {
it('should be iterable', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these tests should be skipped when the environment lacks Symbols.

class Foo extends React.Component {
render() {
Expand Down