File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,9 @@ import Coroutine from '../src/Coroutine';
44
55describe ( '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 > ) ;
You can’t perform that action at this time.
0 commit comments