Skip to content

Commit 330132d

Browse files
docs: Add 'What this library can't test' section (#575)
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
1 parent ae2c02a commit 330132d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/intro.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,21 @@ is also a plugin to use testing-library queries for end-to-end tests in
3939
`DOM Testing Library` works with any environment that provides DOM APIs, such as
4040
Jest, Mocha + JSDOM, or a real browser
4141

42+
### What you should avoid with Testing Library
43+
44+
Testing Library encourages you to avoid testing
45+
[implementation details](https://kentcdodds.com/blog/testing-implementation-details)
46+
like the internals of a component you're testing (though it's still possible).
47+
[The Guiding Principles](/docs/guiding-principles) of this library emphasize a
48+
focus on tests that closely resemble how your web pages are interacted by the users.
49+
50+
You may want to avoid following implementation details:
51+
52+
1. Internal state of a component
53+
1. Internal methods of a component
54+
1. Lifecycle methods of a component
55+
1. Child components
56+
4257
[jest]: https://jestjs.io
4358
[jsdom]: https://github.com/jsdom/jsdom
4459
[dom]: dom-testing-library/intro.md

0 commit comments

Comments
 (0)