Skip to content

Commit f24a987

Browse files
make tests consistent
1 parent 9ca1056 commit f24a987

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

tests/Coroutine.test.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import Coroutine from '../src/Coroutine';
44

55
describe('Coroutine', async () => {
66
it('should render empty body until coroutine is resolved', async () => {
7-
const render = async () => <p>test</p>;
7+
async function render() {
8+
return <p>test</p>;
9+
}
810
const TestComponent = Coroutine.create(render);
911
const tree = Renderer.create(<TestComponent />);
1012

@@ -16,9 +18,15 @@ describe('Coroutine', async () => {
1618
});
1719

1820
it('should pass initial information', async () => {
19-
const render = async ({ number }) => <p>{ number }</p>;
20-
const variables = () => ({ number: 13 });
21-
const TestComponent = Coroutine.create(render, variables);
21+
function getVariables() {
22+
return { number: 13 };
23+
};
24+
25+
async function render({ number }) {
26+
return <p>{ number }</p>;
27+
}
28+
29+
const TestComponent = Coroutine.create(render, getVariables);
2230
const tree = Renderer.create(<TestComponent />);
2331

2432
const success = await Renderer.create(<p>{13}</p>);

0 commit comments

Comments
 (0)