11import * as React from 'react' ;
22import { View } from 'react-native' ;
33
4- import { cleanupAsync , deprecated_renderSync , render } from '../pure' ;
4+ import { cleanup , render , unsafe_renderSync } from '../pure' ;
55
66class Test extends React . Component < { onUnmount : ( ) => void } > {
77 componentWillUnmount ( ) {
@@ -14,24 +14,24 @@ class Test extends React.Component<{ onUnmount: () => void }> {
1414 }
1515}
1616
17- test ( 'cleanup after deprecated_renderSync ' , async ( ) => {
17+ test ( 'cleanup after render ' , async ( ) => {
1818 const fn = jest . fn ( ) ;
1919
20- deprecated_renderSync ( < Test onUnmount = { fn } /> ) ;
21- deprecated_renderSync ( < Test onUnmount = { fn } /> ) ;
20+ await render ( < Test onUnmount = { fn } /> ) ;
21+ await render ( < Test onUnmount = { fn } /> ) ;
2222 expect ( fn ) . not . toHaveBeenCalled ( ) ;
2323
24- await cleanupAsync ( ) ;
24+ await cleanup ( ) ;
2525 expect ( fn ) . toHaveBeenCalledTimes ( 2 ) ;
2626} ) ;
2727
28- test ( 'cleanup after render ' , async ( ) => {
28+ test ( 'cleanup after unsafe_renderSync ' , async ( ) => {
2929 const fn = jest . fn ( ) ;
3030
31- await render ( < Test onUnmount = { fn } /> ) ;
32- await render ( < Test onUnmount = { fn } /> ) ;
31+ unsafe_renderSync ( < Test onUnmount = { fn } /> ) ;
32+ unsafe_renderSync ( < Test onUnmount = { fn } /> ) ;
3333 expect ( fn ) . not . toHaveBeenCalled ( ) ;
3434
35- await cleanupAsync ( ) ;
35+ await cleanup ( ) ;
3636 expect ( fn ) . toHaveBeenCalledTimes ( 2 ) ;
3737} ) ;
0 commit comments