Skip to content

Commit 87ffd32

Browse files
committed
rename deprecated to unsafe_
1 parent ed413fc commit 87ffd32

File tree

15 files changed

+184
-201
lines changed

15 files changed

+184
-201
lines changed

src/__tests__/cleanup.test.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import { View } from 'react-native';
33

4-
import { cleanupAsync, deprecated_renderSync, render } from '../pure';
4+
import { cleanup, render, unsafe_renderSync } from '../pure';
55

66
class 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

Comments
 (0)