Skip to content

Commit

Permalink
Rename AsyncMode -> ConcurrentMode (#13732)
Browse files Browse the repository at this point in the history
* Rename AsyncMode -> ConcurrentMode
  • Loading branch information
trueadm committed Sep 26, 2018
1 parent f0270dd commit 648bf73
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions src/ReactTestRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import * as TestRendererScheduling from './ReactTestRendererScheduling';

type TestRendererOptions = {
createNodeMock: (element: React$Element<any>) => any,
unstable_isAsync: boolean,
unstable_isConcurrent: boolean,
};

type ReactTestRendererJSON = {|
Expand Down Expand Up @@ -419,13 +419,13 @@ function propsMatch(props: Object, filter: Object): boolean {
const ReactTestRendererFiber = {
create(element: React$Element<any>, options: TestRendererOptions) {
let createNodeMock = defaultTestOptions.createNodeMock;
let isAsync = false;
let isConcurrent = false;
if (typeof options === 'object' && options !== null) {
if (typeof options.createNodeMock === 'function') {
createNodeMock = options.createNodeMock;
}
if (options.unstable_isAsync === true) {
isAsync = true;
if (options.unstable_isConcurrent === true) {
isConcurrent = true;
}
}
let container = {
Expand All @@ -435,7 +435,7 @@ const ReactTestRendererFiber = {
};
let root: FiberRoot | null = TestRenderer.createContainer(
container,
isAsync,
isConcurrent,
false,
);
invariant(root != null, 'something went wrong');
Expand Down
14 changes: 7 additions & 7 deletions src/__tests__/ReactTestRendererAsync-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('ReactTestRendererAsync', () => {
return props.children;
}
const renderer = ReactTestRenderer.create(<Foo>Hi</Foo>, {
unstable_isAsync: true,
unstable_isConcurrent: true,
});

// Before flushing, nothing has mounted.
Expand Down Expand Up @@ -59,7 +59,7 @@ describe('ReactTestRendererAsync', () => {
);
}
const renderer = ReactTestRenderer.create(<Parent step={1} />, {
unstable_isAsync: true,
unstable_isConcurrent: true,
});

expect(renderer).toFlushAll(['A:1', 'B:1', 'C:1']);
Expand All @@ -85,7 +85,7 @@ describe('ReactTestRendererAsync', () => {
);
}
const renderer = ReactTestRenderer.create(<Parent step={1} />, {
unstable_isAsync: true,
unstable_isConcurrent: true,
});

// Flush the first two siblings
Expand Down Expand Up @@ -122,7 +122,7 @@ describe('ReactTestRendererAsync', () => {
}

const renderer = ReactTestRenderer.create(<Example step={1} />, {
unstable_isAsync: true,
unstable_isConcurrent: true,
});

// Flush the some of the changes, but don't commit
Expand Down Expand Up @@ -152,7 +152,7 @@ describe('ReactTestRendererAsync', () => {
<Yield id="baz" />
</div>,
{
unstable_isAsync: true,
unstable_isConcurrent: true,
},
);

Expand All @@ -174,7 +174,7 @@ describe('ReactTestRendererAsync', () => {
<Yield id="baz" />
</div>,
{
unstable_isAsync: true,
unstable_isConcurrent: true,
},
);

Expand Down Expand Up @@ -218,7 +218,7 @@ describe('ReactTestRendererAsync', () => {
}

const renderer = ReactTestRenderer.create(<App />, {
unstable_isAsync: true,
unstable_isConcurrent: true,
});

expect(() => {
Expand Down

0 comments on commit 648bf73

Please sign in to comment.