Skip to content

Commit 7a1c264

Browse files
Esemesekthymikee
authored andcommitted
Docs: Remove shallow API from docs (#154)
1 parent e8a817c commit 7a1c264

File tree

3 files changed

+2
-18
lines changed

3 files changed

+2
-18
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ You finally want to approach testing using only best practices, while Enzyme may
2828

2929
## This solution
3030

31-
The `react-native-testing-library` is a lightweight solution for testing your React Native components. It provides light utility functions on top of `react-test-renderer` letting you always be up to date with latest React features and write any component tests you like, be it shallow or deeply rendered ones. But really not any, it prevents you from testing implementation details because we stand this is a very bad practice.
31+
The `react-native-testing-library` is a lightweight solution for testing your React Native components. It provides light utility functions on top of `react-test-renderer` letting you always be up to date with latest React features and write any component tests you like. But really not any, it prevents you from testing implementation details because we stand this is a very bad practice.
3232

3333
This library is a replacement for [Enzyme](http://airbnb.io/enzyme/). It is tested to work with Jest, but it should work with other test runners as well.
3434

@@ -76,7 +76,6 @@ As you may have noticed, it's not tied to React Native at all – you can safely
7676
The [public API](https://callstack.github.io/react-native-testing-library/docs/api) of `react-native-testing-library` is focused around these essential methods:
7777

7878
- [`render`](https://callstack.github.io/react-native-testing-library/docs/api#render) – deeply renders given React element and returns helpers to query the output components.
79-
- [`shallow`](https://callstack.github.io/react-native-testing-library/docs/api#shallow) – shallowly renders given React component. It doesn't return any helpers to query the output.
8079
- [`fireEvent`](https://callstack.github.io/react-native-testing-library/docs/api#fireevent) - invokes named event handler on the element.
8180
- [`waitForElement`](https://callstack.github.io/react-native-testing-library/docs/api#waitforelement) - waits for non-deterministic periods of time until your element appears or times out.
8281
- [`flushMicrotasksQueue`](https://callstack.github.io/react-native-testing-library/docs/api#flushmicrotasksqueue) - waits for microtasks queue to flush.

docs/API.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,6 @@ toJSON(): ReactTestRendererJSON | null
9393

9494
Get the rendered component JSON representation, e.g. for snapshot testing.
9595

96-
## `shallow`
97-
98-
- [`Example code`](https://github.com/callstack/react-native-testing-library/blob/master/src/__tests__/shallow.test.js)
99-
100-
Shallowly renders given React component.
101-
102-
```jsx
103-
import { shallow } from 'react-native-testing-library';
104-
105-
test('Component has a structure', () => {
106-
const { output } = shallow(<Component />);
107-
expect(output).toMatchSnapshot();
108-
});
109-
```
110-
11196
## `fireEvent`
11297

11398
```ts

docs/GettingStarted.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ You finally want to approach testing using only best practices, while Enzyme may
1313

1414
## This solution
1515

16-
The `react-native-testing-library` is a lightweight solution for testing your React Native components. It provides light utility functions on top of `react-test-renderer` letting you always be up to date with latest React features and write any component tests you like, be it shallow or deeply rendered ones. But really not any, it prevents you from testing implementation details because we stand this is a very bad practice.
16+
The `react-native-testing-library` is a lightweight solution for testing your React Native components. It provides light utility functions on top of `react-test-renderer` letting you always be up to date with latest React features and write any component tests you like. But really not any, it prevents you from testing implementation details because we stand this is a very bad practice.
1717

1818
This library is a replacement for [Enzyme](http://airbnb.io/enzyme/).
1919

0 commit comments

Comments
 (0)